Skip to content

Commit

Permalink
Test custom logging conf
Browse files Browse the repository at this point in the history
  • Loading branch information
andreaceccanti committed Sep 14, 2021
1 parent f6bb42b commit 1828bf0
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 1 deletion.
42 changes: 42 additions & 0 deletions compose/custom-logging/logback-spring.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
<?xml version="1.0" encoding="UTF-8"?>

<configuration>

<include resource="org/springframework/boot/logging/logback/defaults.xml" />
<include resource="org/springframework/boot/logging/logback/console-appender.xml" />

<appender name="AUDIT" class="ch.qos.logback.core.rolling.RollingFileAppender">

<File>${IAM_LOG_PATH:=/var/log/iam}/iam-audit.log</File>

<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<FileNamePattern>${IAM_LOG_PATH:-/var/log/iam}/iam-audit-%d{yyyy-MM-dd}.log.gz</FileNamePattern>
</rollingPolicy>

<encoder>
<pattern>${FILE_LOG_PATTERN}</pattern>
</encoder>
</appender>

<appender name="SERVICE" class="ch.qos.logback.core.rolling.RollingFileAppender">

<File>${IAM_LOG_PATH:-/var/log/iam}/iam-service.log</File>

<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<FileNamePattern>${IAM_LOG_PATH:-/var/log/iam}/iam-service-%d{yyyy-MM-dd}.log.gz</FileNamePattern>
</rollingPolicy>

<encoder>
<pattern>${FILE_LOG_PATTERN}</pattern>
</encoder>
</appender>

<logger name="AUDIT" additivity="false" level="INFO">
<appender-ref ref="AUDIT" />
</logger>

<root level="INFO">
<appender-ref ref="CONSOLE" />
<appender-ref ref="SERVICE" />
</root>
</configuration>
6 changes: 5 additions & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
version: '3.5'

volumes:
logs:
db_data:
trust:

Expand Down Expand Up @@ -48,7 +49,7 @@ services:

environment:
TZ: Europe/Rome
IAM_JAVA_OPTS: -Djava.security.egd=file:/dev/./urandom -Xdebug -Xrunjdwp:server=y,transport=dt_socket,suspend=n,address=1044 -Dspring.profiles.active=mysql-test
IAM_JAVA_OPTS: -Djava.security.egd=file:/dev/./urandom -Xdebug -Xrunjdwp:server=y,transport=dt_socket,suspend=n,address=1044 -Dspring.profiles.active=mysql-test -debug
IAM_JAR: /code/iam-login-service/target/iam-login-service.war
IAM_HOST: iam.local.io
IAM_BASE_URL: https://iam.local.io
Expand Down Expand Up @@ -85,8 +86,11 @@ services:

volumes:
- trust:/etc/grid-security/certificates
- logs:/var/log/iam
- .:/code:ro
- /dev/urandom:/dev/random
- ./compose/custom-logging/logback-spring.xml:/indigo-iam/logback-spring.xml:ro

# - ./compose/metadata/iam.local.io.metadata.xml:/indigo-iam/iam.local.io.metadata.xml:ro
# - ./compose/metadata/spid-idp.example.metadata.xml:/indigo-iam/spid-idp.example.metadata.xml:ro
# - ./compose/custom-saml/application-saml.yml:/indigo-iam/config/application-saml.yml:ro
Expand Down

0 comments on commit 1828bf0

Please sign in to comment.