[NETCONF-766] Logging al RESTCONF requests and responses Created: 09/Mar/21 Updated: 07/Sep/23 |
|
| Status: | In Review |
| Project: | netconf |
| Component/s: | restconf-nb |
| Affects Version/s: | None |
| Fix Version/s: | 7.0.0 |
| Type: | New Feature | Priority: | Medium |
| Reporter: | Jaroslav Tóth | Assignee: | Peter Puškár |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Description |
|
There should be an option to log whole RESTCONF traffic - requests and responses - without external dependency. Customer-based requirements about the contents of logs (user ID is probably one of the most important fields - native Jetty logger/LoggingFeature from Jersey will not help much):
Next requirements:
Requests and responses can be logged separately. Note: we can inspire by LoggingFeature or LoggingFilter (jersey). |
| Comments |
| Comment by Jaroslav Tóth [ 09/Mar/21 ] |
|
proposal: https://git.opendaylight.org/gerrit/c/netconf/+/95439 available configuration in org.opendaylight.restconf.nb.rfc8040.cfg (logging is disabled by default): #restconf-logging-enabled=true #logging-headers-enabled=true #logging-query-parameters-enabled=true #logging-body-enabled=true #hidden-http-headers=Authorization,Cookie all logs are generated from single class - if user wants to append them to separate file, the following section can be added to org.ops4j.pax.logging.cfg:
# RESTCONF
log4j2.appender.restconf.type = RollingRandomAccessFile
log4j2.appender.restconf.name = Restconf
log4j2.appender.restconf.fileName = ${karaf.data}/log/restconf.log
log4j2.appender.restconf.filePattern = ${karaf.data}/log/restconf.log.%i
log4j2.appender.restconf.append = true
log4j2.appender.restconf.layout.type = PatternLayout
log4j2.appender.restconf.layout.pattern = %d{ISO8601} | %-5p | %d{UNIX_MILLIS} | %c{1} | %m%n
log4j2.appender.restconf.policies.type = Policies
log4j2.appender.restconf.policies.size.type = SizeBasedTriggeringPolicy
log4j2.appender.restconf.policies.size.size = 64MB
log4j2.appender.restconf.strategy.type = DefaultRolloverStrategy
log4j2.appender.restconf.strategy.max = 7log4j2.logger.restconf.name = org.opendaylight.restconf.nb.rfc8040.jersey.providers.logging.RestconfLoggingBroker
log4j2.logger.restconf.level = TRACE
log4j2.logger.restconf.additivity = false
log4j2.logger.restconf.appenderRef.Restconf.ref = Restconf
|
| Comment by Martin Skorupski [ 10/Mar/21 ] |
|
+1 |