Git Product home page Git Product logo

Comments (5)

bluedenim avatar bluedenim commented on June 1, 2024

I think it's just a configuration issue. Here's a sample project that should get you started:

log4j2.zip

from log4j-s3-search.

bluedenim avatar bluedenim commented on June 1, 2024

Here's how to exercise it after expanding:

cd <where log4j2.zip was expanded>
mvn install

cd target
java -cp log4j-s3-search-log4j2-sample.jar example.App

The output of running the program:

15:49:30,852 [main] INFO  example.App - Hello from Main!
15:49:30,857 [main] INFO  example.App - Another round through the loop!
15:49:30,857 [main] WARN  example.App - This is a warning!
15:49:30,857 [main] ERROR example.App - And this is an error!!!
15:49:33,870 [main] INFO  example.App - Another round through the loop!
15:49:33,870 [main] WARN  example.App - This is a warning!
15:49:33,870 [main] ERROR example.App - And this is an error!!!
15:49:36,877 [main] INFO  example.App - Another round through the loop!
15:49:36,877 [main] WARN  example.App - This is a warning!
15:49:36,877 [main] ERROR example.App - And this is an error!!!
15:49:39,884 [main] INFO  example.App - Another round through the loop!
15:49:39,884 [main] WARN  example.App - This is a warning!
15:49:39,886 [main] ERROR example.App - And this is an error!!!
15:49:42,898 [main] INFO  example.App - Another round through the loop!
15:49:42,898 [main] WARN  example.App - This is a warning!
15:49:42,898 [main] ERROR example.App - And this is an error!!!
LoggingEventCache com.van.logging.LoggingEventCache@27c6e487: shutting down
LoggingEventCache: Executor service terminated within timeout: true
CapacityBasedBufferMonitor: shutting down.

from log4j-s3-search.

nikhithareddy-modak avatar nikhithareddy-modak commented on June 1, 2024

Can you please explain the sentence "Exclude all the transitive dependencies to external libs so we get to specify the versions we want ", that you have written in pom.xml

from log4j-s3-search.

bluedenim avatar bluedenim commented on June 1, 2024

Sure. So when I built appender-core, for example, I used com.amazonaws:aws-java-sdk:1.11.613 (see https://github.com/bluedenim/log4j-s3-search/blob/master/pom.xml#L46-L50).

So if you don't change anything, when you depend on com.therealvan:appender-log4j2:2.8.3, it depends on com.therealvan:appender-core:2.8.3, and that depends on com.amazonaws:aws-java-sdk:1.11.613. So the transitive dependency of your program now includes com.amazonaws:aws-java-sdk:1.11.613.

When I do this:

                <exclusion>
                    <groupId>com.amazonaws</groupId>
                    <artifactId>aws-java-sdk-s3</artifactId>
                </exclusion>

It removes com.amazonaws:aws-java-sdk:1.11.613 from your final project. This will allow you to now add the version of com.amazonaws:aws-java-sdk-s3 that you want. Maybe you want a newer version of AWS S3 SDK than 1.11.613. Instead of waiting for me to update my library, you can:

  • Add the exclude above, then
  • Add the dependency to the version of AWS S3 you want (maybe 1.11.907) in your pom.xml

https://www.educba.com/maven-exclude-dependency/ explains it better if you want details.

from log4j-s3-search.

nikhithareddy-modak avatar nikhithareddy-modak commented on June 1, 2024

Thank you! My issue got solved it was because of not using latest dependencies of log4j2 and also for not included maven shade plugin in pom.xml

from log4j-s3-search.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.