Skip to content

Commit

Permalink
Log to Sematext
Browse files Browse the repository at this point in the history
  • Loading branch information
vicziani committed Sep 22, 2021
1 parent 63c2681 commit 2e2e65d
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/main/resources/application.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ publish.url.prefix = http://localhost:8080

management.endpoints.web.exposure.include = info,health

logging.level.org.apache.cxf.services = debug
logging.level.com.learnwebservices = debug
logging.level.org.apache.cxf.services = warn

management.endpoints.web.cors.allowed-origins=http://localhost:4000
management.endpoints.web.cors.allowed-methods=GET
Expand Down
27 changes: 27 additions & 0 deletions src/main/resources/logback-sematext.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<include resource="org/springframework/boot/logging/logback/default.xml"/>
<include resource="org/springframework/boot/logging/logback/console-appender.xml" />
<appender name="SYSLOG" class="ch.qos.logback.classic.net.SyslogAppender">
<syslogHost>logsene-syslog-receiver.sematext.com</syslogHost>
<port>514</port>
<facility>LOCAL0</facility>
<throwableExcluded>true</throwableExcluded>
<suffixPattern>${SEMATEXT_ID}:@cee: {"logger": "%logger", "level":"%level", "thread":"%thread",
"message":"%replace(%message){'\"', '\''}", "exception":"%replace(%ex){'\"', '\''}",
"@timestamp":"%date{"yyyy-MM-dd'T'HH:mm:ss,SSSXXX", UTC}"}
</suffixPattern>
</appender>

<root level="WARN">
<appender-ref ref="CONSOLE" />
<appender-ref ref="SYSLOG"/>
</root>

<logger name="com.learnwebservices.LearnWebservicesApp" level="INFO" />

<logger name="com.learnwebservices" level="DEBUG" />

<logger name="org.apache.cxf.services" level="INFO" />

</configuration>

0 comments on commit 2e2e65d

Please sign in to comment.