mirror of
https://github.com/Stirling-Tools/Stirling-PDF.git
synced 2026-09-02 21:03:34 +03:00
# Description of Changes <!-- Please provide a summary of the changes, including: - What was changed - Why the change was made - Any challenges encountered Closes #(issue_number) --> --- ## Checklist ### General - [ ] I have read the [Contribution Guidelines](https://github.com/Stirling-Tools/Stirling-PDF/blob/main/CONTRIBUTING.md) - [ ] I have read the [Stirling-PDF Developer Guide](https://github.com/Stirling-Tools/Stirling-PDF/blob/main/DeveloperGuide.md) (if applicable) - [ ] I have read the [How to add new languages to Stirling-PDF](https://github.com/Stirling-Tools/Stirling-PDF/blob/main/devGuide/HowToAddNewLanguage.md) (if applicable) - [ ] I have performed a self-review of my own code - [ ] My changes generate no new warnings ### Documentation - [ ] I have updated relevant docs on [Stirling-PDF's doc repo](https://github.com/Stirling-Tools/Stirling-Tools.github.io/blob/main/docs/) (if functionality has heavily changed) - [ ] I have read the section [Add New Translation Tags](https://github.com/Stirling-Tools/Stirling-PDF/blob/main/devGuide/HowToAddNewLanguage.md#add-new-translation-tags) (for new translation tags only) ### Translations (if applicable) - [ ] I ran [`scripts/counter_translation.py`](https://github.com/Stirling-Tools/Stirling-PDF/blob/main/docs/counter_translation.md) ### UI Changes (if applicable) - [ ] Screenshots or videos demonstrating the UI changes are attached (e.g., as comments or direct attachments in the PR) ### Testing (if applicable) - [ ] I have run `task check` to verify linters, typechecks, and tests pass - [ ] I have tested my changes locally. Refer to the [Testing Guide](https://github.com/Stirling-Tools/Stirling-PDF/blob/main/DeveloperGuide.md#7-testing) for more details.
88 lines
4.0 KiB
XML
88 lines
4.0 KiB
XML
<?xml version="1.0" encoding="UTF-8"?>
|
|
<configuration>
|
|
<define name="LOG_PATH" class="stirling.software.SPDF.config.LogbackPropertyLoader" />
|
|
|
|
<!-- 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>
|
|
|
|
<!-- Rolling File Appender for Auth Logs -->
|
|
<appender name="AUTHLOG" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
|
<file>${LOG_PATH}/invalid-auths.log</file>
|
|
<encoder>
|
|
<pattern>%d %p %c{1} [%thread] %m%n</pattern>
|
|
</encoder>
|
|
<!-- 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>
|
|
</rollingPolicy>
|
|
</appender>
|
|
|
|
<!-- 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. -->
|
|
<appender name="GENERAL" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
|
<file>${LOG_PATH}/info.log</file>
|
|
<encoder>
|
|
<pattern>%d %p %c{1} [%thread] %m%n</pattern>
|
|
</encoder>
|
|
<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>
|
|
</rollingPolicy>
|
|
</appender>
|
|
|
|
<!-- 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>
|
|
|
|
<!-- Root Logger -->
|
|
<root level="INFO">
|
|
<appender-ref ref="CONSOLE"/>
|
|
<appender-ref ref="GENERAL"/>
|
|
</root>
|
|
|
|
<!-- Specific Logger -->
|
|
<logger name="stirling.software.proprietary.security.CustomAuthenticationFailureHandler"
|
|
level="ERROR" additivity="false">
|
|
<appender-ref ref="CONSOLE"/>
|
|
<appender-ref ref="AUTHLOG"/>
|
|
</logger>
|
|
</configuration>
|