Re: Problems creating custom appender using JPMS service in 3.0.0-beta3

2024-12-04 Thread Ralph Goers
plugins instead of traversing ClassLoaders. We still end up traversing ClassLoaders but in a way that is very well supported by the JDK. So in reality Log4jPlugins.dat was what was converted to be a Java service, not the plugins themselves. Ralph > On Dec 4, 2024, at 10:08 PM, Ralph Goers wr

Re: Problems creating custom appender using JPMS service in 3.0.0-beta3

2024-12-04 Thread Ralph Goers
Some huge points are being overlooked in this discussion. 1. A Plugin is NOT a Java service. You cannot manually create the META-INF/services entry for your plugin as the plugin system won’t recognize it. 2. A Plugin service is a collection of plugins. This is intentional as loading all the plug

[ANNOUNCE] Apache log4j-transform 0.2.0 released

2024-10-30 Thread Ralph Goers
Apache Log4j Transformation Tools team is pleased to announce the `0.2.0` release. This project contains tools for binary postprocessing of projects that use the Apache Log4j API. For further information (support, download, etc.) see the project website[1]. [1] https://logging.apache.org/log4j/tra

Re: jspecify dependency

2024-09-07 Thread Ralph Goers
There was a discussion about this on the dev list back in January. Supposedly the library isn’t required at runtime. But if it is included in module-info I am not sure how you get around that. Ralph > On Sep 7, 2024, at 5:39 PM, PJ Fanning wrote: > > Hi, > I just upgraded and then quickly rev

Re: Feature Request: Named Arguments for Structured Logging such as JSON

2024-04-07 Thread Ralph Goers
I wasn’t aware GoLang had a “standard” logger. Last time I checked GoLang’s logging library was awful. Log4j 2 has supported what you want ever since Json Template Layout was added. See https://logging.apache.org/log4j/2.x/manual/json-template-layout.html. To get what you want just specify a pa

Re: Wrapped exceptions

2024-04-07 Thread Ralph Goers
enabled > users to serve themselves instead. > > On Thu, Apr 4, 2024 at 10:46 PM Piotr P. Karwasz > wrote: > >> Hi Ralph, >> >> On Thu, 4 Apr 2024 at 21:01, Ralph Goers >> wrote: >>> I really have no idea why but this is the first time I have he

Re: Wrapped exceptions

2024-04-04 Thread Ralph Goers
I really have no idea why but this is the first time I have heard someone ask for the ability to filter based on the Exception class. We haven’t implemented a Filter to do this but I would imagine it could easily be done. I would imagine it would: a) let you specify a list of Exception classes a

Re: Dynamic loggers/appenders

2024-02-28 Thread Ralph Goers
If you are creating separate LoggerContext’s then every one of them can have its own configuration. The LoggerContext has an externalMap that you can add items to. You could then create a Lookup to retrieve elements from the external Map to resolve references in a common configuration file share

Re: Support of log4j2

2024-01-10 Thread Ralph Goers
One thing nobody else mentioned. Given that 3.x requires Java 17 you can be assured that we will continue to support 2.x until Java 11s usage drops down under 10% (or possibly lower) based on the usage surveys. This is the same approach we have had with previous JDK versions. I would not expect

Re: Property substitution doesn't work in log4j2 xml config

2023-10-30 Thread Ralph Goers
I’d need to see the rest of your main. For example does it declare a Logger? If so where is it in relation to the static block? Ralph > On Oct 30, 2023, at 7:25 AM, Alex Orlov wrote: > > > Hi all, > > I use log4j 2.21.1. This is my xml config file: > > > > >

Re: Adding more than one syslog appenders with different hostname and port at runtime

2023-10-19 Thread Ralph Goers
.withRoutes(routeList) >> .build()); >> >> RoutingAppender routingAppender = routingBuilder.build(); >> routingAppender.start(); >> config.addAppender(routingAppender); >> builder.add(builder.newLogger("RoutingLo

Re: Adding more than one syslog appenders with different hostname and port at runtime

2023-10-18 Thread Ralph Goers
Why are you doing it this way? Can you not just use the RoutingAppender? https://logging.apache.org/log4j/2.x/manual/appenders.html#RoutingAppender Ralph > On Oct 18, 2023, at 8:50 PM, Ganesh S wrote: > > Hello, > I'm trying to create different logger with different hostname and port for > dif

Re: Are globs or regular expressions supported in logger names in config files?

2023-10-05 Thread Ralph Goers
> On Oct 5, 2023, at 6:47 AM, Volkan Yazıcı wrote: > > Wouldn't it be possible to use an arbiter instead? For instance, you can > use a `ScriptArbiter` that checks the package name, and if matches, passes > the log event to your appender, I don’t see how this accomplishes what was asked. Arbi

Re: Are globs or regular expressions supported in logger names in config files?

2023-10-05 Thread Ralph Goers
> On Oct 5, 2023, at 6:13 AM, Thorsten Schöning > wrote: > > Hi everyone, > > I have many logger names following some naming convention like in the > following examples: > > * org.example.unique_phrase.foo > * org.example.unique_phrase.bar > * org.example.foo.unique_phrase.bar > * org.exam

Re: Log4j module deprecation

2023-09-29 Thread Ralph Goers
e modules. > > Unfortunately I don’t know these modules so I can’t tell, but the way we had > this discussion is extremely frustrating. We should continue on dev@ (again) > > On Thu, Sep 28, 2023, at 22:15, Ralph Goers wrote: >> I created the docker and Kubernetes modules.

Re: Log4j module deprecation

2023-09-28 Thread Ralph Goers
I created the docker and Kubernetes modules. Originally my employer used them when sending data directly via TCP to a forwarder. However, we ran into reliability issues with the forwarder when doing that so we switched to writing to the console, despite benchmarks showing it is slower. But for a

Re: Multiple applications using GetLogger with same name

2023-08-01 Thread Ralph Goers
I answered this same question on the dev list a week ago since you apparently cross posted to both. Here it is again. Your issue is related to you starting and stopping the LoggerContext while your application is in an unknown state. I can think of a few ways to deal with this. 1. Never shutd

[ANNOUNCE] Apache Log4j 3.0.0-alpha1 released

2023-06-21 Thread Ralph Goers
gins to be created through more flexible dependency injection patterns. (for LOG4J2-1188 by Matt Sicker) • Allow to force LOG4J2 to use TCCL only. (for LOG4J2-2171 by rmannibucau, Ralph Goers) • Allow web lookup to access more information. (for LOG4J2-2523 by Romain Manni-Bucau, R

Re: how to use log4j-to-jul with log4j-web

2023-06-02 Thread Ralph Goers
You are correct that log4j-to-jul routes the log4j2 API to java.util.logging. When using log4j-to-jul you cannot use ANY other log4j modules except for log4j-api. You must configure Tomcat’s logging to handle all the logging for your application. Ralph > On Jun 2, 2023, at 3:13 PM, Jason Guil

Re: Java 17 does not satisfy the Java 11 dependency for log4j 2.17.1

2023-04-12 Thread Ralph Goers
.module+el8.6.0+14625+c2f2c058/noarch/fd431d51/package> > > On 2023/04/12 19:46:38 Ralph Goers wrote: >> Log4j doesn't supply an RPM of LOG4J. I'm not even sure how one could do >> that. What is the actual RPM and who provided it? > >> >> Ral

Re: Java 17 does not satisfy the Java 11 dependency for log4j 2.17.1

2023-04-12 Thread Ralph Goers
Log4j doesn’t supply an RPM of LOG4J. I’m not even sure how one could do that. What is the actual RPM and who provided it? Ralph > On Apr 12, 2023, at 12:37 PM, Farrell, James > wrote: > > Hello, > > I'm trying to install log4j 2.17.1 on RHEL 8.7 running Java 17, but rpm is > reporting an e

Re: Having trouble changing a logger's level (threshold) at runtime

2023-02-28 Thread Ralph Goers
doesn’t work correctly then I would want to see the Log4j debug logs from startup to see if there are multiple LoggerContexts and multiple configurations. Ralph > On Feb 28, 2023, at 9:18 PM, Ralph Goers wrote: > > What you are running into is a fundamental difference in how Log4j 1

Re: Having trouble changing a logger's level (threshold) at runtime

2023-02-28 Thread Ralph Goers
What you are running into is a fundamental difference in how Log4j 1.x worked and how Log4j2 works. In Log4j 1 when you added a Logger statement to the configuration it would create a “real” Logger just as if you had called LogManager.getLogger(). Log4j 2.x does not do that. As Pier noted, this

Re: [EXTERNAL] Plugin package scanning deprecation

2023-02-24 Thread Ralph Goers
now and will instead ignore the deprecation warning and > wait for the eventual 3.0 release. > > -Original Message- > From: Ralph Goers > Sent: Friday, February 24, 2023 03:40 PM > To: Log4J Users List > Subject: [EXTERNAL] Re: Plugin package scanning deprecation >

Re: Plugin package scanning deprecation

2023-02-24 Thread Ralph Goers
Note - the annotation processor will still be required in 3.0. Instead of generating a Log4jplugins.dat file it generates a Java class file. That class file is loaded via the ServliceLoader. Also, Log4j 3 requires Java 11 and supports JPMS. With JPMS applications have to specify the annotatio

[ANNOUNCE] Apache Log4j 2.20.0 released

2023-02-21 Thread Ralph Goers
by Piotr P. Karwasz, Federico D’Ambrosio) • Add PatternLayout support for abbreviating the name of all logger components except the 2 rightmost (for LOG4J2-2785 by Ralph Goers, Markus Spann) • Removes internal field that leaked into public API. (for LOG4J2-3615 by Piotr P. Karwasz) • Add a

Re: log4j2 API and JUL logging framework

2023-01-25 Thread Ralph Goers
Volkan, I am not sure what question you are answering but it doesn’t look like the question that was asked. To answer his question you would need to replace log4j-core with log4j-to-jul as a dependency. Ralph > On Jan 25, 2023, at 2:05 AM, Volkan Yazıcı wrote: > > That is a really good quest

Re: log4j2 API and JUL logging framework

2023-01-24 Thread Ralph Goers
The log4j-jul module is what maps anyone coding to java.util.logging to use Log4j 2 as the recommendation. The log4j-to-jul module is used when Log4j 2 is the API and java.util.logging is the implementation. Note that log4j-to-jul is fairly new. It was introduced by LOG4J2-3282 in Jira in Jan 2

Re: PatternLayout Vs JsonTemplateLayout/JsonLayout Performance Comparision

2022-11-16 Thread Ralph Goers
Personally, I wouldn’t recommend using PatternLayout to render JSON. There are too many things that can go wrong and it is very limiting to do that. Ralph > On Nov 16, 2022, at 10:22 AM, Carter Kozak wrote: > > On Wed, Nov 16, 2022, at 12:09, Christopher Schultz wrote: >> Is it even possible t

Re: PatternLayout Vs JsonTemplateLayout/JsonLayout Performance Comparision

2022-11-16 Thread Ralph Goers
1. We need to mark JsonLayout as deprecated. We no longer recommend using it. Use JsonTemplateLayout instead. 2. The only consideration for JsonTemplateLayout is that you format the template correctly. FWIW, my employer has been using JsonTemplateLayout to log to ELK for quite a while now with

Re: ETA for 2.19.1?

2022-11-10 Thread Ralph Goers
There have only been 2 issues fixed since 2.19.0 was released 2 months ago. I normally wouldn’t perform a release for so few non-critical changes after such a short period of time. Ralph > On Nov 10, 2022, at 1:10 AM, jeffrey.tho...@t-systems.com wrote: > > Hallo Log4j Team, > > any rough ET

Re: Issue after moving to log4j 2.19

2022-10-17 Thread Ralph Goers
rom: Joan ventusproxy > Sent: Sunday, October 16, 2022 9:03 PM > To: 'Log4J Users List' > Subject: RE: Issue after moving to log4j 2.19 > > Is not this? (second gist): > > DEBUG StatusLogger Watching configuration > '/opt/ventusproxy/app/proxy/ROOT/WEB-INF/l

Re: Issue after moving to log4j 2.19

2022-10-15 Thread Ralph Goers
In both of those log files Log4j is not seeing any value as being set of log4j.configurationFile. It is ending up using the default configuration. Ralph > On Oct 15, 2022, at 3:45 PM, Joan ventusproxy > wrote: > > Hi Piotr, > > Thanks for your quick response. > > Below two gists with the tr

Re: JPMS Native Log4j?

2022-10-14 Thread Ralph Goers
> On Oct 14, 2022, at 8:53 AM, Piotr P. Karwasz wrote: > > Hi Clayton, > > On Fri, 14 Oct 2022 at 17:32, Clayton Wohl wrote: >> >> I've heard rumors that the log4j devs are working on a Java 11+ JPMS native >> version of log4j. This would help end users use jlink to package/distribute >> th

[ANNOUNCE] Apache Log4j 2.19.0 released

2022-09-17 Thread Ralph Goers
The Apache Log4j 2 team is pleased to announce the Log4j 2.19.0 release! Apache Log4j is a well known framework for logging application behavior. Log4j 2 is an upgrade to Log4j that provides significant improvements over its predecessor, Log4j 1.x, and provides many other modern features such as

Re: log4j2 and WebSphere

2022-09-09 Thread Ralph Goers
You are in the correct place. You might also search StackOverflow if you haven’t already. We would need some more information on how things are configured and what you have tried. I don’t believe any of the committers use WebSphere but we have had other questions recently. But identifying ho

Re: Converting custom Appender to Log4j v2

2022-09-09 Thread Ralph Goers
> for that purpose. > > Does anyone have any ideas for how I can figure out what > `SandcastleService.main()` is doing with the Log4j v1 `setFile()` method? > The string "SandcastleService.main(" doesn't appear anywhere else in the > code base, so it's not dir

Re: Converting custom Appender to Log4j v2

2022-08-26 Thread Ralph Goers
> On Aug 26, 2022, at 1:45 PM, Joel Griffith wrote: > > > Its purpose is to change the output file of the Root Logger's FileAppender > (we assume it has only one), or to add a new FileAppender to the Root > Logger if one does not already exist. I can eliminate this use of > FileAppender.setF

Re: Converting custom Appender to Log4j v2

2022-08-24 Thread Ralph Goers
In Log4j 1.2 a Category was the base class for a Logger. So this would simply be looking for all the Appenders attached to the Logger. If a Category/Logger has no Appenders then it searches the parent hierarchy until it finds one. Note that even if it finds one if the Logger is configured as

Re: Converting custom Appender to Log4j v2

2022-08-15 Thread Ralph Goers
t;else { >throw ex; >} >} >else { >throw ex; >} >} >Writer fw = createWriter(ostream); >if (this.bufferedIO) { >fw = new BufferedWriter(fw, t

Re: Converting custom Appender to Log4j v2

2022-08-15 Thread Ralph Goers
This is a problem. Log4j supports Lookups, which usually eliminate the need to override things like setFile since you can create a custom lookup to do whatever needs to be done. Is there any chance you can post the code so we can figure out what it does? Ralph > On Aug 15, 2022, at 8:21 AM, Jo

Re: "ERROR StatusLogger Reconfiguration failed" when running log4j-1.2-api from uber-jar

2022-07-07 Thread Ralph Goers
The recommended approach is to do what Spring Boot does - build a jar that has all its dependent jars in a directory. A jar is just a zip file so you can either unzip it before running or have the start up program set the classpath to the directory inside the zip. Of course, that may mean you n

Re: "ERROR StatusLogger Reconfiguration failed" when running log4j-1.2-api from uber-jar

2022-07-06 Thread Ralph Goers
When you run as an uber jar you are most likely breaking things. Log4j uses a file named Log4j2Plugins.dat to define its plugins. Every jar that has Log4j plugins will have one. When you create an uber jar most likely only one is left and it probably doesn’t contain the core Log4j stuff. To so

[ANNOUNCE] Apache Log4j 2.18.0 released

2022-07-02 Thread Ralph Goers
The Apache Log4j 2 team is pleased to announce the Log4j 2.18.0 release! Apache Log4j is a well known framework for logging application behavior. Log4j 2 is an upgrade to Log4j that provides significant improvements over its predecessor, Log4j 1.x, and provides many other modern features such as

Re: Need help creating second, separate logger

2022-05-20 Thread Ralph Goers
Yes, I’d like to know that too. We have consistently found in the past that questions regarding “how can I make this code work?” almost always do not produce as good results as when answering “how can I make this use case work?”. Ralph > On May 20, 2022, at 6:16 AM, Volkan Yazıcı wrote: > >

Re: shared log4j config used by multiple tomcat webapps

2022-05-12 Thread Ralph Goers
> On May 12, 2022, at 4:16 AM, Dave Piper (HE/HIM) > wrote: > > Hi, > > We've been using log4j for over a decade to produce logs for various webapps > within a single tomcat instance. Some of our loggers and file appenders are > defined within the tomcat/lib folder itself so that they're p

Re: Module or Classpath

2022-04-17 Thread Ralph Goers
I’m not quite clear on the question. Ralph > On Apr 17, 2022, at 4:07 PM, KARTHIK SHIVAKUMAR wrote: > > Hi > > Spec JDK17/Linux/EclipaeJ2EEIDE > > Question : log4j2-core.xx / log4j2-api.xx need to add as *module OR > classpath * >for a new project built from scratch ?

Re: ListAppender in parallel tests

2022-04-14 Thread Ralph Goers
Ideally, parallel tests should use their own LoggerContext. But for the ClassLoaderContextSelector (the default) this would require that each test have its own ClassLoader. In reality it would be better to create a ContextSelect for the framework you are using that keys off of something unique f

Re: can we set log4j property 'Log4jContextSelector' per webapps war

2022-04-06 Thread Ralph Goers
Get Outlook for iOS<https://aka.ms/o0ukef> > ________ > From: Ralph Goers > Sent: Wednesday, April 6, 2022 11:54:26 PM > To: Log4J Users List > Subject: Re: can we set log4j property 'Log4jContextSelector' per webapps war > > *** Ex

Re: can we set log4j property 'Log4jContextSelector' per webapps war

2022-04-06 Thread Ralph Goers
s, log4j2 jars and log4j2 propertie file > are placed under soa-dir/lib. This path is accessible by all 3 wars. I cannot > make any changes in 2 wars which we are fetching from artifactory. > > > > Get Outlook for iOS<https://aka.ms/o0ukef> > ______

Re: can we set log4j property 'Log4jContextSelector' per webapps war

2022-04-06 Thread Ralph Goers
Where are the Log4j jars located? Ralph > On Apr 6, 2022, at 6:34 AM, Pooja Pandey wrote: > > Hi, > > In my application, I have 2 processes running and there are 3 webapps war > files which get deployed in tomcat version 9.0.60. Out of these 3 war files, > one war file is internal to my appl

Re: Configure composite filter for specific logger in Log4j2 via properties file

2022-04-03 Thread Ralph Goers
> On Apr 3, 2022, at 11:59 AM, Piotr P. Karwasz > wrote:. > > I would go even further, regarding the properties format: no Log4j2 > developer uses it and that explains why there are still many bugs in > the `PropertiesConfiguration`. Bugs? When it was first implemented it followed a standa

Re: Configure composite filter for specific logger in Log4j2 via properties file

2022-04-03 Thread Ralph Goers
I would expect the Properties issue would affect all the implementations. The enhancement you suggest would make the properties configuration different than the other configuration formats as they all require the Filters element. This is yet another example of why most (or all) of the log4j 2

Re: How to migrate parameterized messages

2022-03-30 Thread Ralph Goers
If you are doing Logger logger = LogManager.getLogger(“edu.nd.MyClass”); or Logger logger = LogManager.getLogger(edu.nd.MyClass.class); then all you have to do is change the imports from org.apache.log4j to org.apache.logging.log4j. Everything else would be optional. If you are obtaining

Re: Log4j 1.2.x Customer Appender not used as "Plugin" by Log4j 1.2 Bridge

2022-03-29 Thread Ralph Goers
Comments below. > On Mar 29, 2022, at 3:01 PM, Pablo Rogina wrote: > > Ralph, thank you for your reply. > >> To be usable in your configuration a Log4j 1.2 Appender cannot be a Log4j2 >> plugin. > Ok. It is not, as my CustomAppender extends RollingFileAppender (from > Log4j v 1.2.x) > >> You

Re: Log4j 1.2.x Customer Appender not used as "Plugin" by Log4j 1.2 Bridge

2022-03-29 Thread Ralph Goers
To be usable in your configuration a Log4j 1.2 Appender cannot be a Log4j2 plugin. You would configure it exactly as you do in log4j 1.x, via its class name. That said, Do you really need your custom RollingFileAppender? The RollingFileAppender in Log4j 2 has many more options than Log4j 1 did.

Re: manual log4j2 initialization inside webapp ends up in extra LoggerContext

2022-03-24 Thread Ralph Goers
By default, Log4j 2 uses ClassLoaderContextSelector. The way this works is that whenever LogManager.getLogger() is called LogManager will call ClassLoaderContextSelector which will locate the LoggerContext associated with the ClassLoader of the class that called LogManager.getLogger(). In web c

Re: [External] org.apache.logging.log4j.jmx.HierarchyDynamicMBean not found in log4j 2

2022-03-22 Thread Ralph Goers
DynamicMBean class be packaged part of log4j2? > Can the HierarchyDynamicMBean be extracted from log4j-1 and add it log4j-2? > Any suggestions on how to migrate log4j2? > > Thank you > > Shaib > > -Original Message- > From: Ralph Goers <mailto:ralph.go...@dsle

Re: org.apache.logging.log4j.jmx.HierarchyDynamicMBean not found in log4j 2

2022-03-21 Thread Ralph Goers
I’m confused. Log4j 1.x used the package org.apache.log4j. Log4j 2.x uses org.apache.logging.log4j. So how was that class part of Log4j 1.x? Indeed - https://logging.apache.org/log4j/1.2/apidocs/org/apache/log4j/jmx/HierarchyDynamicMBean.html indicates the package name you show below is wrong.

Re: Equivalent of SocketNode class in log4j version 2.17.1

2022-03-17 Thread Ralph Goers
The SocketServer was removed from Log4j 2 in the 2.8.2 release to address CVE-2017-5645. Most implementations used Java serialized events as the format of the data being sent, which is inherently insecure. The code still exists in https://github.com/apache/logging-log4j-tools

Re: Log4j1.x bridge error: Unable to create Lookup for bundle java.lang.ClassCastException: class org.apache.logging.log4j.core.lookup.ResourceBundleLookup

2022-03-08 Thread Ralph Goers
We just released Log4j 2.17.2 last week. I wouldn’t expect the next release until sometime in April. But it all depends on how much gets done. Ralph > On Mar 8, 2022, at 7:39 AM, Pooja Pandey wrote: > > Hi Piotr, > > -> Could you tell us if you have any Log4j libraries in Tomcat's classpath

Re: java.lang.ClassCastException: org.apache.log4j.bridge.AppenderWrapper cannot be cast to org.apache.log4j.FileAppender

2022-03-05 Thread Ralph Goers
anges to > retain the functionality as is. > > Get Outlook for iOS<https://aka.ms/o0ukef> > > From: Ralph Goers > Sent: Saturday, March 5, 2022 9:21:20 AM > To: Log4J Users List > Subject: Re: java.lang.ClassCas

Re: java.lang.ClassCastException: org.apache.log4j.bridge.AppenderWrapper cannot be cast to org.apache.log4j.FileAppender

2022-03-05 Thread Ralph Goers
Piotr, Even if getAppender() were to bypass the AppenderWrapper it would still return org.apache.logging.log4j.core.appender.FileAppender, not org.apache.log4j.FileAppender. Are you proposing that getAppender return a proxy for org.apache.log4j.FileAppender? Ralph > On Mar 5, 2022, at 6:53 A

Re: java.lang.ClassCastException: org.apache.log4j.bridge.AppenderWrapper cannot be cast to org.apache.log4j.FileAppender

2022-03-04 Thread Ralph Goers
22 12:15:55 AM > To: Log4J Users List > Subject: Re: java.lang.ClassCastException: > org.apache.log4j.bridge.AppenderWrapper cannot be cast to > org.apache.log4j.FileAppender > > *** External email: Verify sender before opening attachments or links *** > > > On Fri, Mar 4, 2022 at 7:32 P

Re: java.lang.ClassCastException: org.apache.log4j.bridge.AppenderWrapper cannot be cast to org.apache.log4j.FileAppender

2022-03-04 Thread Ralph Goers
At this point this would be expected. We don’t actually have org.apache.log4j.FileAppender in log4j-1.2-api. We map it to org.apache.logging.log4j.core.appender.FileAppender. I am a little surprised though as it looks like Gary added the Log4j 1.2 FileAppender to log4j-1.2-api but he didn’t rem

Re: Programmatic configuration all or nothing?

2022-03-02 Thread Ralph Goers
As its name implies, ConfigurationBuilder creates a new Configuration. Any Configuration you build this way would replace an existing Configuration. I’d like to understand your use case for wanting Programmatic configuration. If you need to do that either we need to implement some feature so yo

Re: Directionality of Rank between 1.x and 2.x

2022-03-01 Thread Ralph Goers
That would be my doing. There really is no rational reason. I do remember wanting to have the Level be an enum instead of a raw integer but other than that I have no recollection. However, I do remember struggling with the isGreaterThan and isLessThan concept with regard to levels as that actua

[ANNOUNCE] Apache Log4j 2.17.2 released

2022-02-28 Thread Ralph Goers
The Apache Log4j 2 team is pleased to announce the Log4j 2.17.2 release! Apache Log4j is a well known framework for logging application behavior. Log4j 2 is an upgrade to Log4j that provides significant improvements over its predecessor, Log4j 1.x, and provides many other modern features such as

Re: [log4j] PatternLayout %ex{filters(package,package,...)} not implemented?

2022-02-17 Thread Ralph Goers
Note that the intention of %ex has always been to include stack traces similar to those generated by the JVM and so very few options have been added to it. I would suggest that the doc fix is the better way to go. Ralph > On Feb 17, 2022, at 7:17 AM, Janaka Bandara wrote: > > Thanks @Volkan

Re: Release date for log4j 2.17.2?

2022-02-10 Thread Ralph Goers
There is no specific release date. We have a set of Jira issues that we want to include in the release. Once those are all resolved the release will be created. I do not anticipate it taking too much longer at this point, although I had hoped the release would have already been done by now.

Re: log4j RollingFileAppender filePattern issue when using the log4j Bridge

2022-02-02 Thread Ralph Goers
Log4j doesn’t perform releases on a fixed schedule. That said, we have enough stuff to release that one should be forthcoming very soon. Hopefully you would have it in a week or so. Ralph > On Feb 2, 2022, at 9:26 AM, Black, Cody wrote: > > > > From: Black, Cody > Sent: Wednesday, February

Re: Log4j1.x Migration related to security issues

2022-01-15 Thread Ralph Goers
Thanks for these questions. Yes, if you move to Log4j 2.17.1 and use those 3 jars then all Log4j CVEs (both 1.x and 2.x) will have been resolved. How well the log4j-1.2-api works for you will depend on how many customizations you made around Log4j 1.x. The API has always worked well that just d

Re: Configuring Tomcat to use log4j2 - not working, probably a trivial error in log4j2.xml

2022-01-06 Thread Ralph Goers
I haven’t checked Tomcat 9, but the log4j-appserver module was created to hook into Tomcat 8.5 and up. I just not sure if Tomcat changed their logging mechanism yet again. Ralph > On Jan 6, 2022, at 2:43 PM, Bruno Melloni wrote: > > A correction, after doing more troubleshooting and using eve

Re: how to use external log4j2 property file

2022-01-05 Thread Ralph Goers
This is temporary and only enables log4j to debug what is going on with configuration, rollovers, etc. It doesn’t matter where your log4j configuration resides. Please set the property on whatever you use to start your server. Ralph > On Jan 5, 2022, at 1:34 PM, Niranjan Rao wrote: > > On 1/4

Re: how to use external log4j2 property file

2022-01-05 Thread Ralph Goers
OK, what you are doing should work. Can you add -Dlog4j2.debug=true to the application and provide the output from the Log4j StatusLogger? Ralph > On Jan 5, 2022, at 8:33 AM, Jin, Ying wrote: > > Hello Ralph, > > In my previous message that I mentioned that we commented out this file > locat

Re: how to use external log4j2 property file

2022-01-05 Thread Ralph Goers
This may be a silly question, but do each of the entries actually start with #? That would mean all the lines are commented out. Ralph > On Jan 5, 2022, at 7:49 AM, Jin, Ying wrote: > > Ralph, > Thanks for your reply! The two log4j jar files were put in the application's > WEB-INF/lib folder

Re: how to use external log4j2 property file

2022-01-04 Thread Ralph Goers
Where do you have the log4j jar files? In the application, weblogics’s classpath, or both? Ralph > On Jan 4, 2022, at 7:16 PM, Jin, Ying wrote: > > Hello, > > We have a requirement to use external server-side log4j2.properties file for > our log4j2 upgrade projects. After using the following

Re: When was the Security issue caused?

2022-01-04 Thread Ralph Goers
Most security scanners should be following the version rules that are defined in the CVE. For all practical purposes the only versions that are CVE free are 2.3.2 (minimum of Java 6), 2.12.4 (minimum of Java 7), and 2.17.1 (minimum of Java 8). These were all released last week. For other vers

Re: RFC5424Layout - How to format timestamp with microsecond precision

2021-12-29 Thread Ralph Goers
I think you want to set log4j2.clock=org.apache.logging.log4j.core.time.internal.FixedPreciseClock. If you don’t like that implementation you can always provide your own implementation of PreciseClock and specify it on the system property. I’m not sure what performance impact that Clock impleme

[ANNOUNCE} Apache Log4j 2.12.4 released for Java 7 (corrected links)

2021-12-29 Thread Ralph Goers
The Apache Log4j 2 team is pleased to announce the Log4j 2.12.4 release! Apache Log4j is a well known framework for logging application behavior. Log4j 2 is an upgrade to Log4j that provides significant improvements over its predecessor, Log4j 1.x, and provides many other modern features such as

[ANNOUNCE] Apache Log4j 2.12.4 for Java 7 released

2021-12-29 Thread Ralph Goers
The Apache Log4j 2 team is pleased to announce the Log4j 2.12.4 release! Apache Log4j is a well known framework for logging application behavior. Log4j 2 is an upgrade to Log4j that provides significant improvements over its predecessor, Log4j 1.x, and provides many other modern features such as

[ANNOUNCE] Apache Log4j 2.12.3 for Java 7 Released

2021-12-21 Thread Ralph Goers
The Apache Log4j 2 team is pleased to announce the Log4j 2.12.3 release! Apache log4j is a well known framework for logging application behavior. Log4j 2 is an upgrade to Log4j that provides significant improvements over its predecessor, Log4j 1.x, and provides many other modern features such as

[ANNOUNCE] Apache Log4j 2.3.1 for Java 6 released

2021-12-21 Thread Ralph Goers
The Apache Log4j 2 team is pleased to announce the Log4j 2.3.1 release! Apache log4j is a well known framework for logging application behavior. Log4j 2 is an upgrade to Log4j that provides significant improvements over its predecessor, Log4j 1.x, and provides many other modern features such as

Re: Clarification on

2021-12-21 Thread Ralph Goers
The system property blocked lookups from being processed in what I would call “normal” logging - those using the style logger.info(“Hello {}”, name). However, if you made a call like logger.printf(“Hello %s”, name) lookups would not be blocked. If you obtained your logger with a special Logger

Re: Log4j issue

2021-12-19 Thread Ralph Goers
Removing JndiLookup helps by preventing the JNDI attack. You absolutely need to do this if you do not upgrade. For item 2 look at your log4j2 configuration file. If it contains ${ctx:somekey} then you need to understand how somekey is being populated. I would venture to guess that most Log4j2 c

Re: [ANNOUNCEMENT] Apache Log4j 2.17.0 Released

2021-12-18 Thread Ralph Goers
ge here, so first of all, THANK YOU VERY MUCH to the team. You >> really deserve a big present this christmas! >> >> El sáb, 18 dic 2021 a las 18:12, Ralph Goers () >> escribió: >> >>> The Apache Log4j 2 team is pleased to announce the Log4j 2.17.0 rele

Re: [ANNOUNCEMENT] Apache Log4j 2.17.0 Released

2021-12-18 Thread Ralph Goers
. Ralph > On Dec 18, 2021, at 2:01 PM, jmiguel rodriguez > wrote: > > Hi guys, > > First message here, so first of all, THANK YOU VERY MUCH to the team. You > really deserve a big present this christmas! > > El sáb, 18 dic 2021 a las 18:12, Ralph Goers () > escr

[ANNOUNCEMENT] Apache Log4j 2.17.0 Released

2021-12-18 Thread Ralph Goers
The Apache Log4j 2 team is pleased to announce the Log4j 2.17.0 release! Apache Log4j is a well known framework for logging application behavior. Log4j 2 is an upgrade to Log4j that provides significant improvements over its predecessor, Log4j 1.x, and provides many other modern features such as

Re: Minimum requirements for changing log4j.properties -> log4j2.properties

2021-12-17 Thread Ralph Goers
Just needs a Jira issue and/or a PR. Ralph > On Dec 17, 2021, at 6:54 PM, Gary Gregory wrote: > > Looking briefly at the Log4j 1 source code, it looks like the names of > properties are case-insensitive (".file" is the same as ".File") but > in Log4j 2 we might not be as lenient in the compatib

Re: Potential Bug in Log4j2?

2021-12-16 Thread Ralph Goers
Please create a Jira issue for this with as much information as you can. Thanks, Ralph > On Dec 16, 2021, at 5:01 PM, Bhavesh Patel > wrote: > > Hi Matt/Anyone, Any solution for this? > Regards,Bhavesh. >On Thursday, December 16, 2021, 01:57:23 PM PST, Bhavesh Pat

Re: [ANNOUNCEMENT] Apache Log4j 2.15.0 Released

2021-12-10 Thread Ralph Goers
}" > fileName="${mdc:UserId}.log" > filePattern="${mdc:UserId}.%i.log.gz"> > . > > > I tried to lookup documentation of the variable, but unfortunately failed. > > Regards, > > Niranjan > > On 1

[ANNOUNCEMENT] Apache Log4j 2.15.0 Released

2021-12-10 Thread Ralph Goers
The Apache Log4j 2 team is pleased to announce the Log4j 2.15.0 release! Apache Log4j is a well known framework for logging application behavior. Log4j 2 is an upgrade to Log4j that provides significant improvements over its predecessor, Log4j 1.x, and provides many other modern features such as

Re: Web application name.

2021-11-23 Thread Ralph Goers
This is a problematic question. Frequently the name of the web application is considered to be the name of the War file it exists in. AFAIK there is no way to get that. The data in the servlet context may, or may not, represent the application name. A spring boot application on the other hand,

Re: authapi.jar with Log4j2

2021-11-10 Thread Ralph Goers
.common.library.rsa.RSAConnection.getInstance(RSAConnection.java) > > > Thanks. > //Edmondo. > > > > > Il giorno gio 4 nov 2021 alle ore 08:33 Ralph Goers < > ralph.go...@dslextreme.com> ha scritto: > >> You are correct that there is no LocationInfo c

Re: Temporarily store/restore the current configuration

2021-11-09 Thread Ralph Goers
Sorry for not replying sooner but yes, that was going to be my response. Once stopped a Configuration cannot be restarted. I have wanted to be able to provide an easy way to clone a configuration but have never gotten around to it. This would be useful if you have modified the c onfiguration af

Re: downsides/overhead of stashing & restoring (probably empty) ThreadContextMap ?

2021-11-08 Thread Ralph Goers
> On Nov 8, 2021, at 3:04 PM, Chris Hostetter wrote: > > > And if the ThreadContext is _not_ empty? ... is there anything about how > it's implemented that would make the initial map copy (and later > `putAll(...)` call) more "epensive" from a performance standpoint then an > off the shelf

Re: downsides/overhead of stashing & restoring (probably empty) ThreadContextMap ?

2021-11-08 Thread Ralph Goers
Personally, I wouldn’t bother. I have a standard practice of populating the ThreadContextMap from HTTP headers in a ServletFilter and then clearing the ThreadContext on the way out. See https://github.com/apache/logging-log4j-audit/blob/master/log4j-audit/log4j-audit-api/src/main/java/org/apache

Re: authapi.jar with Log4j2

2021-11-04 Thread Ralph Goers
You are correct that there is no LocationInfo constructor. Unfortunately, we can’t really help here without more information. 1. I am assuming this is Auth0’s AuthAPI? I don’t even see them reference any logging framework. 2. If it is brought in by a dependency we would need to see the stack tr

Re: Providing library defaults

2021-10-29 Thread Ralph Goers
I’m not sure I completely understand the question * I’m not sure what you mean by “additive default configuration”. Certainly you can have a default configuration. Use you can add to it. * Don’t log by default would mean that both onMatch and onMismatch are set to DENY Ralph > On Oct 29, 2021,

Re: Log4j2 configuration format with best coverage

2021-10-25 Thread Ralph Goers
This deserves a really long answer that I should add to my blog site. I’ll post a shorter answer on stackoverflow. Ralph > On Oct 25, 2021, at 4:07 AM, Stamatis Zampetakis wrote: > > Hi all, > > I posted the following question on stackoverflow a few days ago [1]. Any > feedback is much apprec

  1   2   3   4   5   6   7   8   9   10   >