Giter VIP home page Giter VIP logo

Comments (3)

j-gurda avatar j-gurda commented on August 11, 2024

Please take a look at #4 (comment)

Maybe this will help.

from lambda-monitoring.

lestephane avatar lestephane commented on August 11, 2024

from lambda-monitoring.

lestephane avatar lestephane commented on August 11, 2024

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)

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.