Commit 2cf8dd3a authored by Ali Saeed's avatar Ali Saeed

Update logback files

parent 23368cdb
...@@ -6,7 +6,6 @@ ...@@ -6,7 +6,6 @@
</encoder> </encoder>
</appender> </appender>
<!-- Console appender -->
<appender name="CONSOLE" class="ch.qos.logback.core.ConsoleAppender"> <appender name="CONSOLE" class="ch.qos.logback.core.ConsoleAppender">
<encoder> <encoder>
<pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n</pattern> <pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n</pattern>
...@@ -18,8 +17,39 @@ ...@@ -18,8 +17,39 @@
<appender-ref ref="CONSOLE"/> <!-- Add the console appender reference --> <appender-ref ref="CONSOLE"/> <!-- Add the console appender reference -->
</logger> </logger>
<root level="error"> <appender name="STASH" class="net.logstash.logback.appender.LogstashTcpSocketAppender">
<destination>localhost:5000</destination>
<encoder
class="net.logstash.logback.encoder.LoggingEventCompositeJsonEncoder">
<providers>
<mdc />
<context />
<logLevel />
<loggerName />
<pattern>
<pattern>
{
"appName": "invoicing-service"
}
</pattern>
</pattern>
<threadName />
<message />
<logstashMarkers />
<stackTrace />
</providers>
</encoder>
</appender>
<logger name="org.example" level="DEBUG" additivity="false">
<appender-ref ref="FILE"/> <appender-ref ref="FILE"/>
<appender-ref ref="CONSOLE"/> <!-- Add the console appender reference --> <appender-ref ref="CONSOLE"/>
<appender-ref ref="STASH" />
</logger>
<root level="INFO">
<appender-ref ref="CONSOLE" />
<appender-ref ref="FILE" />
<appender-ref ref="STASH" />
</root> </root>
</configuration> </configuration>
\ No newline at end of file
...@@ -5,21 +5,44 @@ ...@@ -5,21 +5,44 @@
<pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n</pattern> <pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n</pattern>
</encoder> </encoder>
</appender> </appender>
<!-- Console appender -->
<appender name="CONSOLE" class="ch.qos.logback.core.ConsoleAppender"> <appender name="CONSOLE" class="ch.qos.logback.core.ConsoleAppender">
<encoder> <encoder>
<pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n</pattern> <pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n</pattern>
</encoder> </encoder>
</appender> </appender>
<appender name="STASH" class="net.logstash.logback.appender.LogstashTcpSocketAppender">
<destination>localhost:5000</destination>
<encoder
class="net.logstash.logback.encoder.LoggingEventCompositeJsonEncoder">
<providers>
<mdc />
<context />
<logLevel />
<loggerName />
<pattern>
<pattern>
{
"appName": "replica-invoicing-service"
}
</pattern>
</pattern>
<threadName />
<message />
<logstashMarkers />
<stackTrace />
</providers>
</encoder>
</appender>
<logger name="org.example" level="DEBUG" additivity="false"> <logger name="org.example" level="DEBUG" additivity="false">
<appender-ref ref="FILE"/> <appender-ref ref="FILE"/>
<appender-ref ref="CONSOLE"/> <!-- Add the console appender reference --> <appender-ref ref="CONSOLE"/>
<appender-ref ref="STASH" />
</logger> </logger>
<root level="error"> <root level="INFO">
<appender-ref ref="FILE"/> <appender-ref ref="CONSOLE" />
<appender-ref ref="CONSOLE"/> <!-- Add the console appender reference --> <appender-ref ref="FILE" />
<appender-ref ref="STASH" />
</root> </root>
</configuration> </configuration>
\ No newline at end of file
...@@ -6,20 +6,44 @@ ...@@ -6,20 +6,44 @@
</encoder> </encoder>
</appender> </appender>
<!-- Console appender -->
<appender name="CONSOLE" class="ch.qos.logback.core.ConsoleAppender"> <appender name="CONSOLE" class="ch.qos.logback.core.ConsoleAppender">
<encoder> <encoder>
<pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n</pattern> <pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n</pattern>
</encoder> </encoder>
</appender> </appender>
<appender name="STASH" class="net.logstash.logback.appender.LogstashTcpSocketAppender">
<destination>localhost:5000</destination>
<encoder
class="net.logstash.logback.encoder.LoggingEventCompositeJsonEncoder">
<providers>
<mdc />
<context />
<logLevel />
<loggerName />
<pattern>
<pattern>
{
"appName": "users-service"
}
</pattern>
</pattern>
<threadName />
<message />
<logstashMarkers />
<stackTrace />
</providers>
</encoder>
</appender>
<logger name="org.example" level="DEBUG" additivity="false"> <logger name="org.example" level="DEBUG" additivity="false">
<appender-ref ref="FILE"/> <appender-ref ref="FILE"/>
<appender-ref ref="CONSOLE"/> <!-- Add the console appender reference --> <appender-ref ref="CONSOLE"/>
<appender-ref ref="STASH" />
</logger> </logger>
<root level="error"> <root level="INFO">
<appender-ref ref="FILE"/> <appender-ref ref="CONSOLE" />
<appender-ref ref="CONSOLE"/> <!-- Add the console appender reference --> <appender-ref ref="FILE" />
<appender-ref ref="STASH" />
</root> </root>
</configuration> </configuration>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment