Comments (3)
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.
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.
@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)
- Feature request: Generate CloudFormation for metrics filters HOT 1
- Is there any way to use lambda-logging when running tests on my local machine? HOT 3
- Unable to get stack trace logging to work HOT 3
- How to use this with SLF4J? HOT 1
- aws-lambda-java-core should be declared as provided HOT 1
- Suggestion: Remove @CloudWatchLogGroup annotation HOT 1
- AWS request id shows "NO_REQUEST_ID" HOT 1
- Class path contains SLF4J bindings targeting slf4j-api versions prior to 1.8
- Logging in ForkJoinPool Task has no requestId HOT 2
- Log a custom variable with logs
- Change logging level HOT 1
- Multiple logs per \n - HUGE issue when printing Exceptions! HOT 15
- Problem: can't use line separator with custom config HOT 1
- Critical vulnerability to CVE-2017-5929 HOT 2
- Converting the timestamp from UTC to a local timezone? HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from lambda-monitoring.