Sumologic
sumologic is a cloud platform designed to provide state of the art logging solutions to customers, it has an interactive dashboard to visualize and analyse the logs generated by various components of your solution.
sumologic provides us many integrations for log ingestion, you can install a sumologic installed collector server and point this to the application on your machine to pull the logs, this is called self-installed sumologic server or along these lines, the other is a hosted collector where sumologic has many integration with the most popular applications and collects logs from their platforms.
they also provide application level integrations too, such as log4j and logback for java.
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<include resource="org/springframework/boot/logging/logback/defaults.xml" />
<springProfile name="smart311.production">
<appender name="FILE-ROLLING" class="ch.qos.logback.core.rolling.RollingFileAppender">
<file>logs/smart311.production</file>
<rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
<fileNamePattern>logs/archived/app.%d{yyyy-MM-dd}.%i.log
</fileNamePattern>
<!-- each archived file, size max 10MB -->
<maxFileSize>10MB</maxFileSize>
<!-- total size of all archive files, if total size > 20GB, it will delete
old archived file -->
<totalSizeCap>20GB</totalSizeCap>
<!-- 60 days to keep -->
<maxHistory>60</maxHistory>
</rollingPolicy>
<encoder>
<pattern>%date [%t] %-5p %c - %m%n</pattern>
</encoder>
</appender>
<appender name="SumoAppender" class="com.sumologic.logback.SumoLogicAppender">
<encoder>
<pattern>
%date{ISO8601,UTC} [%t] %-5p %c - %m%n
</pattern>
</encoder>
<url>-----PUBLIC_ENDPOINT_FROM_SUMOLOGIC</url>
</appender>
<logger name="com.nebulogic" level="DEBUG">
<appender-ref ref="FILE-ROLLING" />
<appender-ref ref="SumoAppender"/>
</logger>
<logger name="org.springframework.web.filter.CommonsRequestLoggingFilter" level="DEBUG">
<appender-ref ref="FILE-ROLLING" />
<appender-ref ref="SumoAppender"/>
</logger>
<root level="INFO">
<appender-ref ref="FILE-ROLLING" />
<appender-ref ref="SumoAppender"/>
</root>
<root level="ERROR">
<appender-ref ref="FILE-ROLLING"/>
<appender-ref ref="SumoAppender"/>
</root>
</springProfile>
</configuration>In this example we are using the sumologic logback integration from the maven repo
<dependency>
<groupId>com.sumologic.plugins.logback</groupId>
<artifactId>sumologic-logback-appender</artifactId>
<version>1.7</version>
</dependency>using this and the above config file, all the logs generated will be saved in a file as well as streamed to sumologic.