Files
Stirling-PDF/app/core/src/main/resources/logback.xml
T

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

88 lines
4.0 KiB
XML
Raw Normal View History

2025-01-06 12:41:30 +00:00
<?xml version="1.0" encoding="UTF-8"?>
2023-12-16 18:18:00 +00:00
<configuration>
2025-01-06 12:41:30 +00:00
<define name="LOG_PATH" class="stirling.software.SPDF.config.LogbackPropertyLoader" />
2023-12-16 18:18:00 +00:00
<!-- Console Appender -->
<appender name="CONSOLE" class="ch.qos.logback.core.ConsoleAppender">
<encoder>
<pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n</pattern>
</encoder>
</appender>
2025-01-06 12:41:30 +00:00
<!-- Rolling File Appender for Auth Logs -->
2023-12-16 18:18:00 +00:00
<appender name="AUTHLOG" class="ch.qos.logback.core.rolling.RollingFileAppender">
2025-01-06 12:41:30 +00:00
<file>${LOG_PATH}/invalid-auths.log</file>
2023-12-16 18:18:00 +00:00
<encoder>
<pattern>%d %p %c{1} [%thread] %m%n</pattern>
</encoder>
2026-09-01 20:55:59 +01:00
<!-- SizeAndTime, not Time alone: the size trigger is what stops a
runaway logger filling the disk (see GENERAL appender note).
Archives are gzipped, so 64 MB of them holds far more than a
day. Worst case on disk is one 100 MB live file plus the cap. -->
<rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
<fileNamePattern>${LOG_PATH}/auth-%d{yyyy-MM-dd}.%i.log.gz</fileNamePattern>
<maxFileSize>100MB</maxFileSize>
<maxHistory>7</maxHistory>
<totalSizeCap>64MB</totalSizeCap>
2023-12-16 18:18:00 +00:00
</rollingPolicy>
</appender>
2026-09-01 20:55:59 +01:00
<!-- Rolling File Appender for General Logs
Why SizeAndTimeBased + totalSizeCap: a previous build of the v2 PDF
text editor's reverse-CMap probe loop triggered PDSimpleFont to emit
one "No Unicode mapping for .notdef" WARN per probed charcode per
font per request. With TimeBasedRollingPolicy alone there was no
size ceiling; info.log grew to 1.4 GB in a single day before the JVM
choked. The class-level silencer fixes the specific offender, but
this size cap is the defence-in-depth: any future logger that
floods unexpectedly will roll + auto-delete instead of starving
disk + Jetty threads. -->
2023-12-16 18:18:00 +00:00
<appender name="GENERAL" class="ch.qos.logback.core.rolling.RollingFileAppender">
2025-01-06 12:41:30 +00:00
<file>${LOG_PATH}/info.log</file>
2023-12-16 18:18:00 +00:00
<encoder>
<pattern>%d %p %c{1} [%thread] %m%n</pattern>
</encoder>
2026-09-01 20:55:59 +01:00
<rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
<fileNamePattern>${LOG_PATH}/info-%d{yyyy-MM-dd}.%i.log.gz</fileNamePattern>
<maxFileSize>100MB</maxFileSize>
<maxHistory>7</maxHistory>
<totalSizeCap>256MB</totalSizeCap>
2023-12-16 18:18:00 +00:00
</rollingPolicy>
</appender>
2026-09-01 20:55:59 +01:00
<!-- Suppress PDFBox PDSimpleFont's per-charcode .notdef WARN.
Required by the v2 PDF text editor's `buildReverseUnicodeMap`
which DELIBERATELY iterates every charcode in 0..0xFFFF to
discover the encoding-to-Unicode map of an embedded subset
font. For any subset font ~99% of those probes hit .notdef,
and the default WARN level for those misses turned info.log
into a 1.4 GB monster overnight.
This declarative logback entry is the SOLE mechanism: it is
visible to ops and revertable via configuration. An earlier
build also mutated this logger's level from a static block in
PdfTextEditorCharcodeController, which silenced the same
warnings JVM-wide with no trace in any config file - that
static block has been removed in favour of this entry. -->
<logger name="org.apache.pdfbox.pdmodel.font.PDSimpleFont"
level="ERROR" additivity="false">
<appender-ref ref="CONSOLE"/>
<appender-ref ref="GENERAL"/>
</logger>
2023-12-16 18:18:00 +00:00
<!-- Root Logger -->
2023-12-16 19:29:43 +00:00
<root level="INFO">
2023-12-16 18:18:00 +00:00
<appender-ref ref="CONSOLE"/>
<appender-ref ref="GENERAL"/>
</root>
<!-- Specific Logger -->
2025-07-15 14:01:11 +01:00
<logger name="stirling.software.proprietary.security.CustomAuthenticationFailureHandler"
2025-01-06 12:41:30 +00:00
level="ERROR" additivity="false">
2023-12-16 18:18:00 +00:00
<appender-ref ref="CONSOLE"/>
<appender-ref ref="AUTHLOG"/>
</logger>
2025-06-09 12:51:41 +01:00
</configuration>