Skip to content
Open
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
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
# profile
# profile
test
73 changes: 73 additions & 0 deletions logback-fluency.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
<configuration debug="false">
<statusListener class="ch.qos.logback.core.status.NopStatusListener" />
<timestamp key="byDay" datePattern="yyyy-MM-dd" />

<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
<filter class="ch.qos.logback.classic.filter.ThresholdFilter">
<level>${logLevel}</level>
</filter>
<encoder>
<pattern>BLAH [%level] %logger{45}:%X{line} | %msg%n</pattern>
</encoder>
</appender>

<variable name="FLUENCY_ENDPOINT" value="${FLUENCY_ENDPOINT:-FLUENCY_ENDPOINT}" />
<variable name="FLUENCY_PORT" value="${FLUENCY_PORT:-FLUENCY_PORT}" />
<variable name="FLUENCY_TAG" value="${FLUENCY_TAG:-FLUENCY_TAG}" />

<appender name="FLUENCY" class="ch.qos.logback.more.appenders.FluencyLogbackAppender">

<remoteHost>${FLUENCY_ENDPOINT}</remoteHost>
<port>${FLUENCY_PORT}</port>
<tag>${FLUENCY_TAG}</tag>

<!-- [Optional] Configurations to customize Fluency's behavior: https://github.com/komamitsu/fluency#usage -->
<ackResponseMode>false</ackResponseMode>
<fileBackupDir>/tmp</fileBackupDir>
<!-- Initial chunk buffer size is 1MB (by default)-->
<bufferChunkInitialSize>2097152</bufferChunkInitialSize>
<!--Threshold chunk buffer size to flush is 4MB (by default)-->
<bufferChunkRetentionSize>16777216</bufferChunkRetentionSize>
<!-- Max total buffer size is 512MB (by default)-->
<maxBufferSize>268435456</maxBufferSize>
<!-- Max wait until all buffers are flushed is 10 seconds (by default)-->
<waitUntilBufferFlushed>30</waitUntilBufferFlushed>
<!-- Max wait until the flusher is terminated is 10 seconds (by default) -->
<waitUntilFlusherTerminated>40</waitUntilFlusherTerminated>
<!-- Max retry of sending events is 8 (by default) -->
<senderMaxRetryCount>12</senderMaxRetryCount>
<!-- [Optional] Enable/Disable use of EventTime to get sub second resolution of log event date-time -->
<useEventTime>true</useEventTime>

<encoder>
<pattern>%date %level [%thread] %logger{45} [%file:%line] %msg%n</pattern>
</encoder>
</appender>

<logger name="io.netty" level="ERROR" additivity="false">
<appender-ref ref="STDOUT" />
<appender-ref ref="FILEOUT" />
<appender-ref ref="FLUENCY" />
</logger>
<logger name="io.vertx" level="ERROR" additivity="false">
<appender-ref ref="STDOUT" />
<appender-ref ref="FILEOUT" />
<appender-ref ref="FLUENCY" />
</logger>

<!-- Loggers for our application -->
<logger name="edu.ucla.library.iiif.fester" level="DEBUG" additivity="false">
<appender-ref ref="STDOUT" />
<appender-ref ref="FILEOUT" />
<appender-ref ref="FLUENCY" />
</logger>

<!-- Default logging level for everything else -->
<root level="INFO">
<appender-ref ref="STDOUT" />
<appender-ref ref="FILEOUT" />
<appender-ref ref="FLUENCY" />
</root>

</configuration>

14 changes: 14 additions & 0 deletions logback-simple.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<configuration>

<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
<!-- encoders are assigned the type
ch.qos.logback.classic.encoder.PatternLayoutEncoder by default -->
<encoder>
<pattern>%d{HH:mm:ss.SSS} -- [%thread] %-5level %logger{36} - %msg%n</pattern>
</encoder>
</appender>

<root level="debug">
<appender-ref ref="STDOUT" />
</root>
</configuration>
236 changes: 236 additions & 0 deletions logback-xml-generic.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,236 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>

<appender name="AppStdoutLog" class="ch.qos.logback.core.ConsoleAppender">
<target>System.out</target>
<filter class="edu.illinois.library.cantaloupe.logging.ApplicationLogFilter" />
<filter class="edu.illinois.library.cantaloupe.logging.StandardOutputLogFilter" />
<encoder>
<!-- %white and %gray seem to be inverted as of version 1.1.7 -->
<pattern>%d{HH:mm:ss} [%thread] %highlight(%-5level) %cyan(%logger{15}) - %msg%n</pattern>
</encoder>
<withJansi>true</withJansi>
</appender>

<appender name="AppStderrLog" class="ch.qos.logback.core.ConsoleAppender">
<target>System.err</target>
<filter class="edu.illinois.library.cantaloupe.logging.ApplicationLogFilter" />
<filter class="edu.illinois.library.cantaloupe.logging.StandardErrorLogFilter" />
<encoder>
<pattern>%d{HH:mm:ss} [%thread] %highlight(%-5level) %cyan(%logger{15}) - %msg%n</pattern>
</encoder>
<withJansi>true</withJansi>
</appender>

<if condition='property("log.application.FileAppender.enabled").contains("true")'>
<then>
<appender name="AppFileLog" class="ch.qos.logback.core.FileAppender">
<filter class="edu.illinois.library.cantaloupe.logging.ApplicationLogFilter" />
<file>${log.application.FileAppender.pathname}</file>
<encoder>
<pattern>%date %level [%thread] %logger{10} [%file:%line] %msg%n</pattern>
</encoder>
</appender>
</then>
</if>

<if condition='property("log.error.FileAppender.enabled").contains("true")'>
<then>
<appender name="ErrorFileLog" class="ch.qos.logback.core.FileAppender">
<filter class="edu.illinois.library.cantaloupe.logging.ApplicationErrorLogFilter" />
<file>${log.error.FileAppender.pathname}</file>
<encoder>
<pattern>%date %level [%thread] %logger{10} [%file:%line] %msg%n</pattern>
</encoder>
</appender>
</then>
</if>

<if condition='property("log.application.RollingFileAppender.enabled").contains("true")'>
<then>
<appender name="AppRollingFileLog" class="ch.qos.logback.core.rolling.RollingFileAppender">
<filter class="edu.illinois.library.cantaloupe.logging.ApplicationLogFilter" />
<file>${log.application.RollingFileAppender.pathname}</file>
<if condition='property("log.application.RollingFileAppender.policy").contains("TimeBasedRollingPolicy")'>
<then>
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<fileNamePattern>${log.application.RollingFileAppender.TimeBasedRollingPolicy.filename_pattern}</fileNamePattern>
<maxHistory>${log.application.RollingFileAppender.TimeBasedRollingPolicy.max_history}</maxHistory>
</rollingPolicy>
</then>
</if>
<encoder>
<pattern>%date %level [%thread] %logger{10} [%file:%line] %msg%n</pattern>
</encoder>
</appender>
</then>
</if>

<if condition='property("log.error.RollingFileAppender.enabled").contains("true")'>
<then>
<appender name="ErrorRollingFileLog" class="ch.qos.logback.core.rolling.RollingFileAppender">
<filter class="edu.illinois.library.cantaloupe.logging.ApplicationErrorLogFilter" />
<file>${log.error.RollingFileAppender.pathname}</file>
<if condition='property("log.error.RollingFileAppender.policy").contains("TimeBasedRollingPolicy")'>
<then>
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<fileNamePattern>${log.error.RollingFileAppender.TimeBasedRollingPolicy.filename_pattern}</fileNamePattern>
<maxHistory>${log.error.RollingFileAppender.TimeBasedRollingPolicy.max_history}</maxHistory>
</rollingPolicy>
</then>
</if>
<encoder>
<pattern>%date %level [%thread] %logger{10} [%file:%line] %msg%n</pattern>
</encoder>
</appender>
</then>
</if>

<if condition='property("log.application.SyslogAppender.enabled").contains("true")'>
<then>
<appender name="AppSyslogLog" class="ch.qos.logback.classic.net.SyslogAppender">
<filter class="edu.illinois.library.cantaloupe.logging.ApplicationLogFilter" />
<syslogHost>${log.application.SyslogAppender.host}</syslogHost>
<port>${log.application.SyslogAppender.port}</port>
<facility>${log.application.SyslogAppender.facility}</facility>
</appender>
</then>
</if>

<appender name="AccessStdoutLog" class="ch.qos.logback.core.ConsoleAppender">
<filter class="edu.illinois.library.cantaloupe.logging.AccessLogFilter" />
<encoder>
<pattern>%msg%n</pattern>
</encoder>
</appender>

<if condition='property("log.access.FileAppender.enabled").contains("true")'>
<then>
<appender name="AccessFileLog" class="ch.qos.logback.core.FileAppender">
<filter class="edu.illinois.library.cantaloupe.logging.AccessLogFilter" />
<file>${log.access.FileAppender.pathname}</file>
<encoder>
<!-- already in W3C Extended Log File Format -->
<pattern>%msg%n</pattern>
</encoder>
</appender>
</then>
</if>

<if condition='property("log.access.RollingFileAppender.enabled").contains("true")'>
<then>
<appender name="AccessRollingFileLog" class="ch.qos.logback.core.rolling.RollingFileAppender">
<filter class="edu.illinois.library.cantaloupe.logging.AccessLogFilter" />
<file>${log.access.RollingFileAppender.pathname}</file>
<if condition='property("log.access.RollingFileAppender.policy").contains("TimeBasedRollingPolicy")'>
<then>
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<fileNamePattern>${log.access.RollingFileAppender.TimeBasedRollingPolicy.filename_pattern}</fileNamePattern>
<maxHistory>${log.access.RollingFileAppender.TimeBasedRollingPolicy.max_history}</maxHistory>
</rollingPolicy>
</then>
</if>
<encoder>
<!-- already in W3C Extended Log File Format -->
<pattern>%msg%n</pattern>
</encoder>
</appender>
</then>
</if>

<if condition='property("log.access.SyslogAppender.enabled").contains("true")'>
<then>
<appender name="AccessSyslogLog" class="ch.qos.logback.classic.net.SyslogAppender">
<filter class="edu.illinois.library.cantaloupe.logging.AccessLogFilter" />
<syslogHost>${log.access.SyslogAppender.host}</syslogHost>
<port>${log.access.SyslogAppender.port}</port>
<facility>${log.access.SyslogAppender.facility}</facility>
</appender>
</then>
</if>

<logger name="edu.illinois.library.cantaloupe.logging.AccessLogService" additivity="false">
<if condition='property("log.access.ConsoleAppender.enabled").contains("true")'>
<then>
<appender-ref ref="AccessStdoutLog" />
</then>
</if>
<if condition='property("log.access.FileAppender.enabled").contains("true")'>
<then>
<appender-ref ref="AccessFileLog" />
</then>
</if>
<if condition='property("log.access.RollingFileAppender.enabled").contains("true")'>
<then>
<appender-ref ref="AccessRollingFileLog" />
</then>
</if>
<if condition='property("log.access.SyslogAppender.enabled").contains("true")'>
<then>
<appender-ref ref="AccessSyslogLog" />
</then>
</if>
</logger>

<root level="${log.application.level}">
<!--
Access log appenders
-->
<if condition='property("log.access.ConsoleAppender.enabled").contains("true")'>
<then>
<appender-ref ref="AccessStdoutLog" />
</then>
</if>
<if condition='property("log.access.FileAppender.enabled").contains("true")'>
<then>
<appender-ref ref="AccessFileLog" />
</then>
</if>
<if condition='property("log.access.RollingFileAppender.enabled").contains("true")'>
<then>
<appender-ref ref="AccessRollingFileLog" />
</then>
</if>
<if condition='property("log.access.SyslogAppender.enabled").contains("true")'>
<then>
<appender-ref ref="AccessSyslogLog" />
</then>
</if>

<!--
Application log appenders
-->
<if condition='property("log.application.ConsoleAppender.enabled").contains("true")'>
<then>
<appender-ref ref="AppStdoutLog" />
<appender-ref ref="AppStderrLog" />
</then>
</if>
<if condition='property("log.application.FileAppender.enabled").contains("true")'>
<then>
<appender-ref ref="AppFileLog" />
</then>
</if>
<if condition='property("log.error.FileAppender.enabled").contains("true")'>
<then>
<appender-ref ref="ErrorFileLog" />
</then>
</if>
<if condition='property("log.application.RollingFileAppender.enabled").contains("true")'>
<then>
<appender-ref ref="AppRollingFileLog" />
</then>
</if>
<if condition='property("log.error.RollingFileAppender.enabled").contains("true")'>
<then>
<appender-ref ref="ErrorRollingFileLog" />
</then>
</if>
<if condition='property("log.application.SyslogAppender.enabled").contains("true")'>
<then>
<appender-ref ref="AppSyslogLog" />
</then>
</if>
</root>

</configuration>
Loading