Skip to content

Commit

Permalink
feat: Add ClpIrFileAppender, AbstractBufferedRollingFileAppender, and…
Browse files Browse the repository at this point in the history
… AbstractClpIrBufferedRollingFileAppender. (#8)

Co-authored-by: phalani <[email protected]>
Co-authored-by: Kirk Rodrigues <[email protected]>
  • Loading branch information
3 people authored Nov 5, 2024
1 parent 2e61c59 commit 8304621
Show file tree
Hide file tree
Showing 12 changed files with 1,883 additions and 13 deletions.
25 changes: 25 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -38,21 +38,45 @@

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>

<!-- Dependency versions -->
<com.github.luben.zstd-jni.version>1.5.6-7</com.github.luben.zstd-jni.version>
<com.yscope.clp.clp-ffi.version>0.4.7</com.yscope.clp.clp-ffi.version>
<commons-io.commons-io.version>2.17.0</commons-io.commons-io.version>
<org.apache.logging.log4j.version>2.24.1</org.apache.logging.log4j.version>
<org.junit.jupiter.version>5.11.3</org.junit.jupiter.version>
</properties>

<dependencies>
<dependency>
<groupId>com.yscope.clp</groupId>
<artifactId>clp-ffi</artifactId>
<version>${com.yscope.clp.clp-ffi.version}</version>
</dependency>
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<version>${commons-io.commons-io.version}</version>
</dependency>

<!-- Provided dependencies -->
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-api</artifactId>
<version>${org.apache.logging.log4j.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-core</artifactId>
<version>${org.apache.logging.log4j.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.github.luben</groupId>
<artifactId>zstd-jni</artifactId>
<version>${com.github.luben.zstd-jni.version}</version>
<scope>provided</scope>
</dependency>

<!-- Dependencies for testing -->
Expand Down Expand Up @@ -170,6 +194,7 @@
<configuration>
<effort>Max</effort>
<includeTests>true</includeTests>
<excludeFilterFile>${project.basedir}/spotbugs-exclude.xml</excludeFilterFile>
</configuration>
</plugin>

Expand Down
49 changes: 49 additions & 0 deletions spotbugs-exclude.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
<FindBugsFilter>
<Match>
<Bug category="BAD_PRACTICE" code="CT" value="CT_CONSTRUCTOR_THROW" />
<Class name="com.yscope.logging.log4j2.AbstractBufferedRollingFileAppender" />
<Justification>Log4j2 should throw immediately if configurations are wrong.</Justification>
</Match>

<Match>
<Bug category="BAD_PRACTICE" code="CT" value="CT_CONSTRUCTOR_THROW" />
<Class name="com.yscope.logging.log4j2.ClpIrFileAppender" />
<Justification>Log4j2 should throw immediately if configurations are wrong.</Justification>
</Match>

<Match>
<Bug category="BAD_PRACTICE" code="CT" value="CT_CONSTRUCTOR_THROW" />
<Class name="com.yscope.logging.log4j2.CompressionPatternLayoutContainer" />
<Justification>Log4j2 should throw immediately if configurations are wrong.</Justification>
</Match>

<Match>
<Bug category="MALICIOUS_CODE" code="EI" value="EI_EXPOSE_REP" />
<Class name="com.yscope.logging.log4j2.PatternLayoutBufferDestination" />
<Justification>False positive: Simply returning the buffer. No security check required.</Justification>
</Match>

<Match>
<Bug category="PERFORMANCE" code="UrF" value="URF_UNREAD_FIELD" />
<Class name="com.yscope.logging.log4j2.AbstractBufferedRollingFileAppender$Builder" />
<Justification>False positive: Log4j2 plugin attributes.</Justification>
</Match>

<Match>
<Bug category="PERFORMANCE" code="UrF" value="URF_UNREAD_FIELD" />
<Class name="com.yscope.logging.log4j2.AbstractClpIrBufferedRollingFileAppender$Builder" />
<Justification>False positive: Log4j2 plugin attributes.</Justification>
</Match>

<Match>
<Bug category="PERFORMANCE" code="UrF" value="URF_UNREAD_FIELD" />
<Class name="com.yscope.logging.log4j2.ClpIrFileAppender$Builder" />
<Justification>False positive: Log4j2 plugin attributes.</Justification>
</Match>

<Match>
<Bug category="MT_CORRECTNESS" code="IS" value="IS2_INCONSISTENT_SYNC" />
<Class name="com.yscope.logging.log4j2.AbstractBufferedRollingFileAppender" />
<Justification>Custom synchronization is for shutdown after all user threads.</Justification>
</Match>
</FindBugsFilter>
Loading

0 comments on commit 8304621

Please sign in to comment.