Comments (3)
Please take a look at #4 (comment)
Maybe this will help.
from lambda-monitoring.
from lambda-monitoring.
I figured out what is wrong when running outside of AWS. The default layout uses \r
as line separator so that it plays well with CloudWatch. Outside of AWS, this causes the cursor to keep going back to the beginning of the line (clearing what's been written so far) upon encountering \r
. As a result, the only line that gets shown in the terminal is the last one. I resolved the issue by using a different dependency for my local tests:
<dependency>
<groupId>io.symphonia</groupId>
<artifactId>lambda-logging</artifactId>
<classifier>no-config</classifier>
<scope>test</scope>
</dependency>
Combined with a layout in src/test/resources/logback.xml
that does not use \r
:
<pattern>[%d{yyyy-MM-dd HH:mm:ss.SSS}] %X{AWSRequestId:-NO_REQUEST_ID} %highlight(%.-6level) %logger{5} - %msg%nopex%n%highlight(%rEx)</pattern>
The DEFAULT_PATTERN
from symphonia (for reference)
"[%d{yyyy-MM-dd HH:mm:ss.SSS}] %X{AWSRequestId:-" + NO_REQUEST_ID + "} %.-6level %logger{5} - %msg \r%replace(%ex){'\n','\r'}%nopex%n";
I've added extra bells and whistles for my local tests version (highlighting, stack traces always start on the line following the log entry, with root cause first).
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
- 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
- Logs not showing up with SAM local - async issue? HOT 3
- 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.