Comments (14)
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.
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.
@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.
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.
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.
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.
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.
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.
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.
@hagbard hi, any status update? :)
from flogger.
@ronshapiro is there any release planned which provides this new backend, I'm unable to find this artefact in maven yet.
from flogger.
from flogger.
@hagbard Is there an ETA for log4j2 backend maven artifacts?
from flogger.
@hagbard Is there an ETA for log4j2 backend maven artifacts?
from flogger.
Related Issues (20)
- Benchmarks and String Creation HOT 19
- Architecture diagram for flogger
- Extensibility How to HOT 9
- Better document Flogger's status (active, maintained, in use at Google) HOT 5
- Support for java.util.ResourceBundle HOT 9
- Add tags from thread context to log HOT 17
- Use java.time.Duration for atMostEvery in LoggingApi. HOT 2
- Flag --incompatible_disable_starlark_host_transitions will break Flogger in Bazel 7.0 HOT 6
- Release schedule?
- Default JavaDocs generated for Flogger confusingly suggest it's deprecated (it isn't). HOT 2
- How to handle ScopedLoggingContext for new Threads / ThreadPools? HOT 1
- Provide a log writer to produce JSON log items according to Elastic Common Schema HOT 8
- I don't believe ScopedLoggingContexts should obviously accept null "no-op" arguments. HOT 5
- Incorrect caller details logged with Flogger in spring boot HOT 2
- Error: 'JavaInfo' value has no field or method 'transitive_deps' HOT 5
- Error: 'JavaInfo' value has no field or method 'transitive_deps' HOT 5
- Next release HOT 2
- ThreadlocalRandom instead of ThreadLocal HOT 8
- java failed error executing Javac command from target //api:checks HOT 5
- test
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 flogger.