Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix logging #430

Merged
merged 1 commit into from
Jan 18, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions core/src/main/resources/log4j2.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,10 @@
%d{yyyy-MM-dd HH:mm:ss.SSS} %5p ${hostName} --- [%15.15t] %-40.40c{1.} : %m%n%ex
</Property>
<Property name="APPENDER_TYPE">${env:LOG_TYPE:-Console}</Property>
<Property name="LOG_LEVEL">${env:LOG_LEVEL:-info}</Property>
</Properties>
<CustomLevels>
<CustomLevel name="AUDIT" intLevel="350" />
<CustomLevel name="AUDIT" intLevel="350"/>
</CustomLevels>
<Appenders>
<Console name="ConsoleAppender" target="SYSTEM_OUT" follow="true">
Expand All @@ -35,8 +36,11 @@
</Console>
</Appenders>
<Loggers>
<Root level="info">
<AppenderRef ref="${APPENDER_TYPE}Appender" />
</Root>
<Logger name="feast.core" level="debug" additivity="false">
<AppenderRef ref="${APPENDER_TYPE}Appender"/>
</Logger>
<Root level="${LOG_LEVEL}">
<AppenderRef ref="${APPENDER_TYPE}Appender"/>
</Root>
</Loggers>
</Configuration>
9 changes: 0 additions & 9 deletions ingestion/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -225,15 +225,6 @@
<artifactId>slf4j-api</artifactId>
</dependency>

<!-- https://mvnrepository.com/artifact/org.slf4j/slf4j-jdk14 -->
<!-- Add slf4j API frontend binding with JUL backend -->
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
<version>1.2.3</version>
<scope>runtime</scope>
</dependency>

<!-- To run actual Redis for ingestion integration test -->
<dependency>
<groupId>com.github.kstyrc</groupId>
Expand Down
22 changes: 22 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@
<mockito.version>2.28.2</mockito.version>
<!-- OpenCensus is used in grpc and Google's HTTP client libs in Cloud SDKs -->
<opencensus.version>0.21.0</opencensus.version>
<!-- Force log4j2 to 2.11+ to support objectMessageAsJsonObject -->
<log4jVersion>2.12.1</log4jVersion>
</properties>

<organization>
Expand Down Expand Up @@ -261,6 +263,26 @@
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-api</artifactId>
<version>${log4jVersion}</version>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-core</artifactId>
<version>${log4jVersion}</version>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-jul</artifactId>
<version>${log4jVersion}</version>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-slf4j-impl</artifactId>
<version>${log4jVersion}</version>
</dependency>

<!--
Import Spring Boot's dependency management.
Expand Down
14 changes: 9 additions & 5 deletions serving/src/main/resources/log4j2.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,19 +21,23 @@
<Property name="LOG_PATTERN">
%d{yyyy-MM-dd HH:mm:ss.SSS} %5p ${hostName} --- [%15.15t] %-40.40c{1.} : %m%n%ex
</Property>
<Property name="APPENDER_TYPE">${env:LOG_TYPE:-Console}</Property>
<Property name="LOG_LEVEL">${env:LOG_LEVEL:-info}</Property>
</Properties>
<Appenders>
<Console name="ConsoleAppender" target="SYSTEM_OUT" follow="true">
<PatternLayout pattern="${LOG_PATTERN}"/>
</Console>
<Console name="JSONAppender" target="SYSTEM_OUT" follow="true">
<JsonLayout compact="true" eventEol="true" objectMessageAsJsonObject="true" />
</Console>
</Appenders>
<Loggers>
<Logger name="com.gojek.feast" level="info" additivity="false">
<AppenderRef ref="ConsoleAppender" />
<Logger name="feast.serving" level="debug" additivity="false">
<AppenderRef ref="${APPENDER_TYPE}Appender"/>
</Logger>

<Root level="info">
<AppenderRef ref="ConsoleAppender" />
<Root level="${LOG_LEVEL}">
<AppenderRef ref="${APPENDER_TYPE}Appender"/>
</Root>
</Loggers>
</Configuration>