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 >

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

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: 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 > *

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.

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: 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 > > *** External ema

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

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

[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

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

2022-07-07 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

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: 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-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 >

Re: Issue after moving to log4j 2.19

2022-10-17 Thread Ralph Goers
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/log4j.xml' for lastModified Sat

[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

Re: Converting custom Appender to Log4j v2

2022-09-09 Thread Ralph Goers
gt; > 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 directly invoked anywhere. > >

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

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 >>

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

Re: Converting custom Appender to Log4j v2

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

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,

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

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

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

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

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

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

[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: 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
nd 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: Having trouble changing a logger's level (threshold) at runtime

2023-02-28 Thread Ralph Goers
. If this 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: 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

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? > >> >> Ralph >>

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

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

[ANNOUNCE] Apache Log4j 3.0.0-alpha1 released

2023-06-22 Thread Ralph Goers
ow plugins 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: 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: 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

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: 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

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

<    5   6   7   8   9   10