Giter Club home page Giter Club logo

Comments (6)

axelfontaine avatar axelfontaine commented on August 25, 2024

This should be autodetected when running in a Boxfuse instance here: https://github.com/boxfuse/cloudwatchlogs-java-appender/blob/master/src/main/java/com/boxfuse/cloudwatchlogs/internal/CloudwatchLogsLogEventPutter.java#L54

Do you find it making the wrong choice for you? If yes, how so?

from cloudwatchlogs-java-appender.

vdenisov avatar vdenisov commented on August 25, 2024

It works perfectly when running in AWS; and when running in local Boxfuse instance, I can easily fuse an environment variable, so it's not a problem as well. However, if running on a local machine, I have to not forget to set this variable in IDE's run configuration (or set an OS/user level environment variable) myself, and to explain this to all team members who're working with logging. It wasn't a problem until we started migrating all our codebase to use Markers and MDC to get better structured logs - having a way to just set it to a correct AWS region in log4j2.xml (which would then be shared with all team members) would've been nice.

If you're against exposing this config option, that's fine by me; if not - let me implement that (early next week seems likely) and send you a PR.

from cloudwatchlogs-java-appender.

axelfontaine avatar axelfontaine commented on August 25, 2024

Note that there is no need to set anything in a local Boxfuse instance as Boxfuse will automatically override the endpoint to point to a local CloudWatch Logs mock that is started by the Boxfuse Client. See https://github.com/boxfuse/cloudwatchlogs-java-appender/blob/master/src/main/java/com/boxfuse/cloudwatchlogs/CloudwatchLogsConfig.java#L21

Currently the appender auto-disables itself outside of a Boxfuse instance (due to the lack of AWS_REGION and "BOXFUSE_CLOUDWATCHLOGS_ENDPOINT environment variables). I assume this is not the behavior you want. Do you instead want it to log to

  1. AWS CloudWatch Logs
  2. a local CloudWatch Logs mock
  3. stdout

?

from cloudwatchlogs-java-appender.

vdenisov avatar vdenisov commented on August 25, 2024

TBH, I'd like it to log to wherever I can see the whole logged event (to make sure that all the fields are set correctly).

from cloudwatchlogs-java-appender.

axelfontaine avatar axelfontaine commented on August 25, 2024

The new stdoutFallback configuration property now enables outputting events to stdout in case no AWS region was detected.

from cloudwatchlogs-java-appender.

vdenisov avatar vdenisov commented on August 25, 2024

Works very well, thanks a lot!

from cloudwatchlogs-java-appender.

Related Issues (11)

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.