Git Product home page Git Product logo

Comments (14)

hagbard avatar hagbard commented on May 5, 2024 4

The pull request by paladox has now been pulled into the main internal branch and should be available soon on github (hopefully next week). Note that while I added some tests, I'm not particularly confident with the log4j2 APIs so if someone were willing to look over the code and tests to see if I missed anything, that would be great.

from flogger.

brainbytes42 avatar brainbytes42 commented on May 5, 2024 3

Short note for anyone trying to circumvent the missing backend:
You can use log4J2's JUL-Adapter (https://logging.apache.org/log4j/2.x/log4j-jul/index.html) to bridge the gap... BUT: The source location seems to get lost then: While java outputs the method where flogger was called (as expected), this same log entry bridged to log4j2 shows as location this:

com.google.common.flogger.backend.system.AbstractBackend.log(AbstractBackend.java:76)

... which is the location, flogger calls JUL.log().

So, bottom line, it seems to be necessary to have a proper adapter. Maybe if I find some free time in the future... ;-)

from flogger.

clearnote01 avatar clearnote01 commented on May 5, 2024 1

@hagbard Can you help with how to use this with flogger? With maven slf4j/log4j backend are available but it lacks this one. https://mvnrepository.com/artifact/com.google.flogger

from flogger.

hagbard avatar hagbard commented on May 5, 2024

Not yet. Feel free to write one and I'll happily review it (the log4j backend took about 2 days IIRC).
Since Flogger is essentially a part-time one-man project (me) I'm not going to get around to adding more backends any time soon (unless they are needed inside Google).

from flogger.

hagbard avatar hagbard commented on May 5, 2024

I should have time to look at this in the next couple of weeks.However I'm a complete "noob" as regards Log4J2. Are there any aspects of Log4j2 you think I should be aware of?

Also, the easiest version for me to develop against would be v2.8.2 (2017-06-26). Does that work for you? I know it's older, but to develop inside Google we enforce a one-version policy, and 2.8.2 is the latest one we use. I could try developing in open-source against a later version, but it'll be slower for me, since I'm not used to it.

from flogger.

davido avatar davido commented on May 5, 2024

The latest seems to be: http://central.maven.org/maven2/org/apache/logging/log4j/log4j-core/2.11.1. But it is only a couple of months older than 2.8.2. So it would be fine.

from flogger.

hagbard avatar hagbard commented on May 5, 2024

Ta. I'm looking at updating the internal version to 2.11.1, but if it causes any issues I might have to go with 2.8.2. I don't have a feel for how often the APIs for this might change - hopefully all versions are compatible as regards the internal APIs.

from flogger.

davido avatar davido commented on May 5, 2024

I'm looking at updating the internal version to 2.11.1, but if it causes any issues I might have to go with 2.8.2.

+1.

from flogger.

JanecekPetr avatar JanecekPetr commented on May 5, 2024

We (a random passer-by) had a problem with log4j 2.11 and GWT in dev mode and had to downgrade to 2.8. I do not recall the details, but that might be what's holding the Google-internal version to be updated?

Anyway, yes, the log4j API has been super stable for a couple of years now.

from flogger.

paladox avatar paladox commented on May 5, 2024

@hagbard hi, any status update? :)

from flogger.

philnate avatar philnate commented on May 5, 2024

@ronshapiro is there any release planned which provides this new backend, I'm unable to find this artefact in maven yet.

from flogger.

hagbard avatar hagbard commented on May 5, 2024

from flogger.

MosheElisha avatar MosheElisha commented on May 5, 2024

@hagbard Is there an ETA for log4j2 backend maven artifacts?

from flogger.

MosheElisha avatar MosheElisha commented on May 5, 2024

@hagbard Is there an ETA for log4j2 backend maven artifacts?

from flogger.

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.