Skip to content

Commit

Permalink
feat: add more loggers (#3742)
Browse files Browse the repository at this point in the history
Co-authored-by: Yuriy Movchan <Yuriy.Movchan@gmail.com>
  • Loading branch information
yuremm and yurem authored Jan 31, 2023
1 parent 1a2d298 commit 919bc86
Show file tree
Hide file tree
Showing 2 changed files with 53 additions and 13 deletions.
4 changes: 2 additions & 2 deletions jans-auth-server/server/src/main/resources/log4j2.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>

<Configuration packages="org.gluu.log">
<Configuration packages="io.jans.log">
<Appenders>
<Console name="STDOUT" target="SYSTEM_OUT">
<PatternLayout pattern="%d %-5p [%t] [%C{6}] (%F:%L) - %m%n" />
Expand Down Expand Up @@ -97,7 +97,7 @@
<!-- ############### Hibernate logging ################# -->
<Logger name="org.hibernate" level="error" />

<Logger name="org.gluu.jans-auth.audit.debug" level="${log4j.default.log.level}" additivity="false">
<Logger name="io.jans.as.server.audit.debug" level="${log4j.default.log.level}" additivity="false">
<AppenderRef ref="JANS_AUTH_HTTP_REQUEST_RESPONSE_FILE" />
</Logger>

Expand Down
62 changes: 51 additions & 11 deletions jans-fido2/server/src/main/resources/log4j2.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>

<Configuration packages="org.gluu.log">
<Configuration packages="io.jans.log">
<Appenders>
<Console name="STDOUT" target="SYSTEM_OUT">
<PatternLayout pattern="%d{dd-MM HH:mm:ss.SSS} %-5p [%t] [%C{6}] (%F:%L) - %m%n" />
Expand All @@ -17,7 +17,7 @@
<DefaultRolloverStrategy max="15" />
</RollingFile>

<RollingFile name="PERSISTENCE_FILE" fileName="${sys:log.base}/logs/fido2_persistence.log" filePattern="${sys:log.base}/logs/fido2_persistence-%d{yyyy-MM-dd}-%i.log">
<RollingFile name="FIDO2_PERSISTENCE_FILE" fileName="${sys:log.base}/logs/fido2_persistence.log" filePattern="${sys:log.base}/logs/fido2_persistence-%d{yyyy-MM-dd}-%i.log">
<PatternLayout pattern="%d{dd-MM HH:mm:ss.SSS} %-5p [%t] [%C{6}] (%F:%L) - %m%n" />

<Policies>
Expand All @@ -26,28 +26,68 @@
</Policies>
<DefaultRolloverStrategy max="15" />
</RollingFile>

<RollingFile name="FIDO2_PERSISTENCE_DURATION_FILE" fileName="${sys:log.base}/logs/fido2_persistence_duration.log" filePattern="${sys:log.base}/logs/fido2_persistence_duration-%d{yyyy-MM-dd}-%i.log">
<PatternLayout pattern="%d %-5p [%t] %X{X-Correlation-Id} [%C{6}] (%F:%L) - %m%n" />

<Policies>
<TimeBasedTriggeringPolicy interval="1" modulate="true" />
<SizeBasedTriggeringPolicy size="250 MB" />
</Policies>
<DefaultRolloverStrategy max="30" />
</RollingFile>

<RollingFile name="FIDO2_SCRIPT_LOG_FILE" fileName="${sys:log.base}/logs/fido2_script.log" filePattern="${sys:log.base}/logs/fido2_script-%d{yyyy-MM-dd}-%i.log">
<PatternLayout pattern="%d %-5p [%t] %X{X-Correlation-Id} [%C{6}] (%F:%L) - %m%n" />

<Policies>
<TimeBasedTriggeringPolicy interval="1" modulate="true" />
<SizeBasedTriggeringPolicy size="250 MB" />
</Policies>
<DefaultRolloverStrategy max="30" />
</RollingFile>
</Appenders>

<Loggers>
<!-- ############### Gluu ################# -->
<Logger name="org.gluu" level="${log4j.default.log.level}" />
<Logger name=io.jans" level="${log4j.default.log.level}" />
<Logger name="org.gluu.site.ldap" level="${log4j.default.log.level}" additivity="false">
<AppenderRef ref="PERSISTENCE_FILE" />
</Logger>

<Logger name="org.gluu.persist" level="${log4j.default.log.level}" additivity="false">
<AppenderRef ref="PERSISTENCE_FILE" />
<Logger name="io.jans.orm" level="${log4j.default.log.level}" additivity="false">
<AppenderRef ref="FIDO2_PERSISTENCE_FILE" />
</Logger>
<Logger name="com.unboundid.ldap.sdk.LDAPConnection" level="${log4j.default.log.level}" additivity="false">
<AppenderRef ref="PERSISTENCE_FILE" />
<AppenderRef ref="FIDO2_PERSISTENCE_FILE" />
</Logger>
<logger name="com.couchbase.client" level="${log4j.default.log.level}" additivity="false">
<AppenderRef ref="PERSISTENCE_FILE" />
<AppenderRef ref="FIDO2_PERSISTENCE_FILE" />
</logger>
<Logger name="io.jans.orm.ldap.operation.watch" level="${log4j.default.log.level}" additivity="false">
<AppenderRef ref="FIDO2_PERSISTENCE_DURATION_FILE" />
</Logger>
<Logger name="io.jans.orm.couchbase.operation.watch" level="${log4j.default.log.level}" additivity="false">
<AppenderRef ref="FIDO2_PERSISTENCE_DURATION_FILE" />
</Logger>
<Logger name="io.jans.orm.watch" level="${log4j.default.log.level}" additivity="false">
<AppenderRef ref="FIDO2_PERSISTENCE_DURATION_FILE" />
</Logger>
<Logger name="io.jans.service.PythonService" level="${log4j.default.log.level}" additivity="false">
<AppenderRef ref="FIDO2_SCRIPT_LOG_FILE" />
</Logger>
<Logger name="io.jans.service.custom.script" level="${log4j.default.log.level}" additivity="false">
<AppenderRef ref="FIDO2_SCRIPT_LOG_FILE" />
</Logger>
<Logger name="io.jans.fido2.service.shared" level="${log4j.default.log.level}" additivity="false">
<AppenderRef ref="FIDO2_SCRIPT_LOG_FILE" />
</Logger>
<Root level="INFO">
<AppenderRef ref="FILE" />
<AppenderRef ref="STDOUT" />
Expand Down

0 comments on commit 919bc86

Please sign in to comment.