Giter VIP home page Giter VIP logo

Comments (3)

rmmeans avatar rmmeans commented on August 11, 2024

Just thought I would give an update here incase anyone else sees this.

I was able to successfully use aws-lambda-java-log4j2 with version 1.1.0 from amazon. I then used the log4j-slf4j-impl library so that log4j2 is only used as the logging framework for slf4j. This allowed me to use SLF4J api in my libraries and libraries from others that depend on the SLF4J API while having logs route through the recommended and provided AWS logging framework.

Upon doing this, all of my logs are now back in the correct execution order with where the process was at during execution of the Lambda and it is working with SAM local the same it does on AWS lambda.

I'm not sure what the logback appender is doing in what I referenced above as to why it does not appear to be immediately flushing to the output stream for stdout - this is not an issue with SLF4J but with logback as the logging framework and the appender being used it would appear.

from lambda-monitoring.

johnchapin avatar johnchapin commented on August 11, 2024

Thanks for the detailed report - that's a really interesting finding. We're not doing anything particularly wild with logback, so it's definitely unexpected.

I do think it's worth trying to call out to LambdaLogger directly - if you'd like to take a swing at a PR for a new appender I'm happy to review it.

from lambda-monitoring.

johnchapin avatar johnchapin commented on August 11, 2024

@rmmeans - try this again with version 1.0.3 (just released, may take a few hours to hit Maven Central). The lack of a trailing newline was causing some havoc, both in test output and in CloudWatch logs.

from lambda-monitoring.

Related Issues (16)

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.