Git Product home page Git Product logo

Comments (3)

pankajagrawal16 avatar pankajagrawal16 commented on September 26, 2024 1

Hey @dgomesbr Thanks for opening an RFC.

I have few immediate questions/comments on this:

  • Are you thinking that annotation should work like that from lombok in the sense that it should modify byte code to generate log fields for user or just exposing an api from power tool to provide access to logger instance ?
  • If its the former, my concerns are how would the IDE experience look like? Lombok has plugin support in IDE like intellij etc.
  • Goal of powertools logging annotation is to take away heavy lifting of injecting information from lambda context. It's not meant to replace current logging configuration in your lambda functions. You can still use lombok in your lambda functions to make it generate log4j2 logger instance if you want to. As of today the annotation only take effect when use on lambda handleRequest method.

Those are my thoughts around it.

I would still be ok to consider exposing an api method which could give you access to a logger instance, something like PowertoolsLogger.get() and that gives you access to a logger from log4j2, although I am not sure how much value it adds.

from powertools-lambda-java.

dgomesbr avatar dgomesbr commented on September 26, 2024

Fair consideration. My thoughts were if we're pushing the Json Schema, the Log4J2 as best practice, why not generate the log instance itself.

Since bytecode is generated at design time, and not runtime, also don't foresee issues with the performance.
Oth, great points on the IDE support, I guess I have mixed feelings on that.

Maybe then expose this as a member annotation? @LoggerInstance ?
Or maybe we drop it altogether.

from powertools-lambda-java.

pankajagrawal16 avatar pankajagrawal16 commented on September 26, 2024

Fair consideration. My thoughts were if we're pushing the Json Schema, the Log4J2 as best practice, why not generate the log instance itself.

Since bytecode is generated at design time, and not runtime, also don't foresee issues with the performance.
Oth, great points on the IDE support, I guess I have mixed feelings on that.

Maybe then expose this as a member annotation? @LoggerInstance ?
Or maybe we drop it altogether.

@LoggerInstance annotation is an option but I am still doubtful on the value that it will add as the only purpose of it will be to provide logger instance and then clients are free to choose any code generators library like lombok for example. I think it at this point it deviates from our tenets as well. At this point, I am tempted to drop it altogether.

So if you agree with this, feel free to close the issue or else let us know the thoughts further :)

from powertools-lambda-java.

Related Issues (20)

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.