Re: log4j initialization does not seem to happen when Tomcat service is started

2024-03-31 Thread Piers Uso Walter
Hi Piotr, Thanks for the reminder. I did in fact do this, it had already been included in Thad’s solution. The idea of my email was to describe changes I made to Thad’s code. I now realize that it would have been smarter (and more useful to future mailing list readers) if I had included the rest

Re: log4j initialization does not seem to happen when Tomcat service is started

2024-03-31 Thread Piotr P. Karwasz
Hi Piers, On Sun, 31 Mar 2024 at 22:37, Piers Uso Walter wrote: > > Thad, > > > Thanks so much. This looks exactly what I want to do. > But somehow I never got your code to work. > > ... > > I made these changes to your code: > > 1. > LogListener is now a subclass of Log4jServletContextListener,

Re: log4j initialization does not seem to happen when Tomcat service is started

2024-03-31 Thread Piotr P. Karwasz
Hi Piers, On Wed, 20 Mar 2024 at 17:09, Piers Uso Walter wrote: > Am I trying something unusual here when I attempt to make the app decide > where the log4j configuration file is located? > Is there any other way in which I can achieve this? > Is there an API for this? Sorry for the late answer

Re: log4j initialization does not seem to happen when Tomcat service is started

2024-03-31 Thread Piers Uso Walter
Hi Jeff, Thanks for your suggestion. I ended up doing it slightly different (see my response to Thad Humphries). However, I’ll keep your idea in mind because the ability to both include a standard configuration in the app and also optionally modifying this configuration via an external config f

Re: log4j initialization does not seem to happen when Tomcat service is started

2024-03-31 Thread Piers Uso Walter
Thad, Thanks so much. This looks exactly what I want to do. But somehow I never got your code to work. I finally modified your approach a bit, and now it works for me. I am now able to dynamically set the location of the log4j configuration file in my app. And this works not just when the app

Re: log4j initialization does not seem to happen when Tomcat service is started

2024-03-21 Thread Thad Humphries
Piers, I've configured two webapps with the log4j2 configuration outside of the *war files. The approach I'll describe is working in Tomcat 8.5 and Tomcat 9. First I create a LogListener class for the webapp: public class LogListener implements ServletContextListener { private static final Lo

Re: log4j initialization does not seem to happen when Tomcat service is started

2024-03-20 Thread Jeffrey.Thomas
Hi Piers, I am not from Log4j Team - just a user like you :) We have a similar situation with internal distribution configuration and external "customer" configuration. What we are now doing is programmatically creating a CompositeConfiguration with the internal config and external config and

Re: log4j initialization does not seem to happen when Tomcat service is started

2024-03-20 Thread Piers Uso Walter
Hi Piotr, Thanks for your email. Here is what I’m trying to do: The previous version of our app stores the log4j configuration within the war file. This works fine but is annoying if one wants to change any logging setting (unpacking the war, changing the configuration, repacking the war, redep

Re: log4j initialization does not seem to happen when Tomcat service is started

2024-03-14 Thread Piotr P. Karwasz
Hi Piers, On Thu, 14 Mar 2024 at 14:08, Piers Uso Walter wrote: > However, what I was trying to achieve by using a servlet context listener was > to be able to set the location of the log4j configuration file at run time. > I’m trying to make the app compatible with different app servers where

Re: log4j initialization does not seem to happen when Tomcat service is started

2024-03-14 Thread Piers Uso Walter
Hi Piotr, Thanks for your explanation. Indeed, once I hard code the path to the log4j configuration file into web.xml, logging works in both cases (app undeployment/deployment as well as Tomcat shutdown/restart). However, what I was trying to achieve by using a servlet context listener was to

Re: log4j initialization does not seem to happen when Tomcat service is started

2024-03-13 Thread Piotr P. Karwasz
Hi Piers, On Wed, 13 Mar 2024 at 22:29, Piers Uso Walter wrote: > 2024-03-13T19:49:02.609143Z Catalina-utility-1 INFO > Log4jServletContextListener triggered a Log4j context initialization. > > Case 2: > However, if I stop and restart the Tomcat service (with the war file having > been previous

Re: Log4j module deprecation

2023-10-30 Thread Piotr P. Karwasz
Hi all, On Thu, 28 Sept 2023 at 09:35, Piotr P. Karwasz wrote: > We know that statistics are not everything and that is why we would > like to hear your opinion on these modules. The discussion will be > open for a month, after which the PMC will announce a definitive list > of deprecations. It

Re: Log4j module deprecation

2023-09-29 Thread Christian Grobmeier
On Fri, Sep 29, 2023, at 21:40, Ralph Goers wrote: > I believe I shared my misgivings to these two modules since this was > first brought up. I may not have said I am -1 but I definitely never > said “go for it”. I see. Well, I got a different impression when re-reading the discussion, I was

Re: Log4j module deprecation

2023-09-29 Thread Ralph Goers
I believe I shared my misgivings to these two modules since this was first brought up. I may not have said I am -1 but I definitely never said “go for it”. Ralph > On Sep 29, 2023, at 5:36 AM, Christian Grobmeier wrote: > > From an observer of this discussion: > > And I was thinking we have

Re: Log4j module deprecation

2023-09-29 Thread Christian Grobmeier
>From an observer of this discussion: And I was thinking we have had this discussion over at dev@. I am surprised we have seen something which I understood as agreement and then, when we tell the users about our plans, we reopen this discussion. This must be very frustrating for Piotr who colle

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: Log4j module deprecation

2023-09-28 Thread Matt Sicker
* For the Cassandra appender, I’m ok with deprecation. I had added this plugin a while back partly as a demo to show how to write plugins and for some consulting-related use cases, but I haven’t used this in quite some time as I’d lean toward some form of queue middleware between logs and a Cass

Re: Log4j module deprecation

2023-09-28 Thread Volkan Yazıcı
Thanks so much for the feedback Wayne, we really appreciate it. I couldn't follow what you mean with "Java wrappers". Could you elaborate on it, please? Could you give some concrete examples? What was missing? What did you implement? What does it have to do with JNDI and logging? On Thu, Sep 28, 2

Re: Log4j module deprecation

2023-09-28 Thread Wayne Cannon
Volkan, A vote to retain JNDI-related features. Although I don't use JNDI regularly, I have used it several times in the last decade for a Fortune 100 company to create Java wrappers when commercial libraries don't provide a Java interface -- most recently for a commercial product using one of

Re: Log4j module deprecation

2023-09-28 Thread Volkan Yazıcı
I have cross-posted this to GitHub Discussions too. Feel free to participate there, if that is of your preference. On Thu, Sep 28, 2023 at 9:35 AM Piotr P. Karwasz wrote: > Hi all, > > We always strive to only release industrial-streng

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

2022-04-09 Thread Pablo Rogina
Hi Piotr, your suggestion did the trick. I added a CustomAppenderBuilder into the same package of my CustomAppender based on Log4j2. So this new CustomAppenderBuilder can parse a Properties object in Log4j1 syntax and creates CustomAppender v2 via AppenderWrapper (from the Log4j 1.2 Bridge). In

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

2022-03-30 Thread Piotr P. Karwasz
Hello Pablo, On Tue, 29 Mar 2022 at 19:58, Pablo Rogina wrote: > However this warning appears (application launched with -Dlog4j2.debug=true): > WARN StatusLogger Unable to load plugin class name > com.mycompany.log4j.CustomAppender with key > com.mycompany.log4j.customappender This is an expect

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 Pablo Rogina
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 would configure it exactly as you do in log4j 1.x, via its class name. Ok. I think it

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: [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: [log4j] PatternLayout %ex{filters(package,package,...)} not implemented?

2022-02-17 Thread Janaka Bandara
Thanks @Volkan! I'll raise a JIRA ticket. Also thanks @Damien for the pointer on %xEx (before starting this thread I did look up the mail archives but could not find your thread - possibly my inexperience with the filtering). Given that the feature is already supported in ExtendedThrowablePattern

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

2022-02-15 Thread Volkan Yazıcı
Hello Janaka & Damien, This discrepancy indeed seems like a bug. Would you mind first filing a JIRA ticket, please? @Janaka, if you can contribute this feature in a PR that would be great! To avoid redundant iterations, would you mind briefly describing how you plan to address the issue in the ti

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

2022-02-14 Thread Damien Jiang
I also sent a message to the mailing list about this 4 days before: https://lists.apache.org/thread/yoj9bdfqfph6q03t26r5mrdc37zjd9nw but there's been no response yet. For now I just started using %xEx, but I'd appreciate it if this feature could be supported for %ex as well. Thanks, Damien On Su

Re: Log4j

2022-02-04 Thread Volkan Yazıcı
Hello Thyagarajan, `secur...@logging.apache.org` list is used for vulnerability reports, not user questions. Please use `log4j-user@logging.apache.org` mailing list for your questions. Below I try to answer your questions: > 1) Is there any script or command to verify which application utilizes

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: log4j use bridge

2022-01-04 Thread Volkan Yazıcı
Hello, Please use log4j-user@logging.apache.org mailing list for questions, so that others can benefit too. security@ mailing list is used for reporting vulnerabilities. Log4j1 and Log4j2 are two totally separate code bases. The vulnerabilities affecting them are different too, hence those are as

Re: Log4j issue

2021-12-20 Thread bab
I cannot understand what does this mean Otherwise, in the configuration, remove references to Context Lookups like ${ctx:loginId} or $${ctx:loginId} where they originate from sources external to the application such as HTTP headers or user input. 1- Would you say what should I do exactly ?

Re: Log4j issue

2021-12-20 Thread bab
Is that your means have to search "${ctx" in Log4j-config.xsd file ? Would you say exactly what parameters need to remove from Log4j-config.xsd file? Quoting Tushar Kapila : Exact plain string (Non regex) to search would be "${ctx" "somekey" is a placeholder for name of variable. On Mon,

Re: Log4j issue

2021-12-20 Thread Tushar Kapila
Exact plain string (Non regex) to search would be "${ctx" "somekey" is a placeholder for name of variable. On Mon, 20 Dec, 2021, 16:29 , wrote: > I searched ${ctx:somekey} in the log4j-config.xsd file but could not > find anything . > Is that means that is enough If we upgrade to 2.17 or just r

Re: Log4j issue

2021-12-20 Thread bab
I searched ${ctx:somekey} in the log4j-config.xsd file but could not find anything . Is that means that is enough If we upgrade to 2.17 or just remove the class file? Quoting Ralph Goers : Removing JndiLookup helps by preventing the JNDI attack. You absolutely need to do this if you do no

Re: Log4j issue

2021-12-19 Thread bab
I searched ${ctx:somekey} in the log4j-config.xsd file but could not find anything . Is that means that is enough If we upgrade to 2.17 or just remove the class file? Quoting Ralph Goers : Removing JndiLookup helps by preventing the JNDI attack. You absolutely need to do this if you do n

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: log4j 2.15.0 signature and sha512 hash

2021-12-13 Thread Matt Sicker
Thanks for confirming! -- Matt Sicker > On Dec 13, 2021, at 20:02, Daniel Savard wrote: > > Le lun. 13 déc. 2021 à 13:35, Daniel Savard a > écrit : > >> >> - >> Daniel Savard >> >> >> Le lun. 13 déc. 2021 à 13:28, Gary Gregory a >> écrit : >> >>> On Mon, Dec 13, 2021 at 1:

Re: log4j 2.15.0 signature and sha512 hash

2021-12-13 Thread Daniel Savard
Le lun. 13 déc. 2021 à 13:35, Daniel Savard a écrit : > > - > Daniel Savard > > > Le lun. 13 déc. 2021 à 13:28, Gary Gregory a > écrit : > >> On Mon, Dec 13, 2021 at 1:22 PM Daniel Savard >> wrote: >> >> > Le lun. 13 déc. 2021 à 12:34, Gary Gregory a >> > écrit : >> > >> > > Wo

Re: log4j 2.15.0 signature and sha512 hash

2021-12-13 Thread Daniel Savard
- Daniel Savard Le lun. 13 déc. 2021 à 13:28, Gary Gregory a écrit : > On Mon, Dec 13, 2021 at 1:22 PM Daniel Savard > wrote: > > > Le lun. 13 déc. 2021 à 12:34, Gary Gregory a > > écrit : > > > > > Works for me: > > > > > > gpg --verify apache-log4j-2.15.0-bin.tar.gz.asc > >

Re: log4j 2.15.0 signature and sha512 hash

2021-12-13 Thread Gary Gregory
On Mon, Dec 13, 2021 at 1:22 PM Daniel Savard wrote: > Le lun. 13 déc. 2021 à 12:34, Gary Gregory a > écrit : > > > Works for me: > > > > gpg --verify apache-log4j-2.15.0-bin.tar.gz.asc > > > > Here is the content of the asc file: > > -BEGIN PGP SIGNATURE- > > iQIzBAABCgAdFiEEU8k1ghqmp1W

Re: log4j 2.15.0 signature and sha512 hash

2021-12-13 Thread Daniel Savard
Le lun. 13 déc. 2021 à 12:23, Matt Sicker a écrit : > Did you import the keys from our keys file? That should make the > signatures authenticate. > Of course. - Daniel Savard

Re: log4j 2.15.0 signature and sha512 hash

2021-12-13 Thread Daniel Savard
Le lun. 13 déc. 2021 à 12:34, Gary Gregory a écrit : > Works for me: > > gpg --verify apache-log4j-2.15.0-bin.tar.gz.asc > Here is the content of the asc file: -BEGIN PGP SIGNATURE- iQIzBAABCgAdFiEEU8k1ghqmp1W9M321NZU5XrPY4boFAmGySd0ACgkQNZU5XrPY 4bqQtQ/+KXQi3+6LZ13HyEefNsnBm84krCXK/nA

Re: log4j 2.15.0 signature and sha512 hash

2021-12-13 Thread Gary Gregory
Works for me: gpg --verify apache-log4j-2.15.0-bin.tar.gz.asc gpg: assuming signed data in 'apache-log4j-2.15.0-bin.tar.gz' gpg: Signature made Thu Dec 9 13:24:29 2021 EST gpg:using RSA key 53C935821AA6A755BD337DB53595395EB3D8E1BA gpg: Good signature from "Ralph Goers (CODE SIGNI

Re: log4j 2.15.0 signature and sha512 hash

2021-12-13 Thread Matt Sicker
Did you import the keys from our keys file? That should make the signatures authenticate. On Mon, Dec 13, 2021 at 10:52 AM Daniel Savard wrote: > > Hi everyone, > > I am trying to authenticate the log4j-2.15 code downloaded from the > apache.org site and the sha512 file doesn't contain a sha512 h

Re: [log4j][log4j-web] Start and Stop Order?

2021-02-24 Thread Gary Gregory
I think that PR is not helpful for my use case. Also in general, I push back PR like this one because it adds a whole new class with ZERO Javadoc: Log4jShutdownOnContextDestroyedListener Gary On Wed, Feb 24, 2021, 11:47 Matt Sicker wrote: > https://github.com/apache/logging-log4j2/pull/463 add

Re: [log4j][log4j-web] Start and Stop Order?

2021-02-24 Thread Ralph Goers
I’m first on start should always imply I am last on stop. I am not aware of the web fragment support that was added. Ralph > On Feb 24, 2021, at 9:44 AM, Gary Gregory wrote: > > On Wed, Feb 24, 2021 at 11:37 AM Matt Sicker wrote: >> >> This behavior was recently changed but not released yet.

Re: [log4j][log4j-web] Start and Stop Order?

2021-02-24 Thread Gary Gregory
On Wed, Feb 24, 2021 at 11:07 AM Ralph Goers wrote: > > Interesting that you posted this to the user list. I'm a real user in this case :-) > > Last I checked the way the shutdown worked was very much dependent on which > servlet spec version the app is using. As I recall, prior to 3.0 a servle

Re: [log4j][log4j-web] Start and Stop Order?

2021-02-24 Thread Matt Sicker
https://github.com/apache/logging-log4j2/pull/463 added more to this feature. Might help fix your problem. On Wed, 24 Feb 2021 at 10:44, Gary Gregory wrote: > > On Wed, Feb 24, 2021 at 11:37 AM Matt Sicker wrote: > > > > This behavior was recently changed but not released yet. > > It has though:

Re: [log4j][log4j-web] Start and Stop Order?

2021-02-24 Thread Gary Gregory
On Wed, Feb 24, 2021 at 11:37 AM Matt Sicker wrote: > > This behavior was recently changed but not released yet. It has though: 2.14.0's log4j-web contains a web fragment xml configuration file that says "I'm first". The problem is that I need (as does everyone I claim) "I'm first" on start and

Re: [log4j][log4j-web] Start and Stop Order?

2021-02-24 Thread Matt Sicker
This behavior was recently changed but not released yet. On Wed, 24 Feb 2021 at 10:07, Ralph Goers wrote: > > Interesting that you posted this to the user list. > > Last I checked the way the shutdown worked was very much dependent on which > servlet spec version the app is using. As I recall, p

Re: [log4j][log4j-web] Start and Stop Order?

2021-02-24 Thread Ralph Goers
Interesting that you posted this to the user list. Last I checked the way the shutdown worked was very much dependent on which servlet spec version the app is using. As I recall, prior to 3.0 a servlet filter had to be directly configured by the user. Configuring that in the web.xml as the firs

Re: log4j 3.0.0-SNAHSOPT disappeared

2020-11-03 Thread Ralph Goers
Unfortunately, I don’t see 2.x as ever fully supporting the JPMS. I keep wanting to focus solely on 3.0 to get it released but there is still so much work to do that it is difficult since we can’t put everything on hold until then. Ralph > On Nov 3, 2020, at 8:57 AM, Oliver Kopp wrote: > > H

Re: log4j 3.0.0-SNAHSOPT disappeared

2020-11-03 Thread Oliver Kopp
Hi, Sure. I think, we thought, fixing snapshot usage issues (and possibly report back issues) would help log4j more than staying with a pinned snapshot. Surely, this will cause troubles when initiating a release for Debian. Maybe a 3.0.0 release happens before all other dependencies of our projec

Re: log4j 3.0.0-SNAHSOPT disappeared

2020-11-03 Thread Oliver Kopp
Hi, Matt Sicker schrieb am Di., 3. Nov. 2020, 15:23: I’m not particularly sure why you’ve chosen 3.x Because our issue seems not to be solved for the 2.x release according to the state of LOG4J2-2690 - https://issues.apache.org/jira/browse/LOG4J2-2690?focusedCommentId=16927936&page=com.atlassi

Re: log4j 3.0.0-SNAHSOPT disappeared

2020-11-03 Thread Ralph Goers
Snapshots are not releases and we don’t guarantee we won’t make breaking changes. If you want to use 3.0.0 in a production environment you should clone the repo locally and create a tag and create an internal release for yourself. You should also use a version number that won’t conflict with ou

Re: log4j 3.0.0-SNAHSOPT disappeared

2020-11-03 Thread Matt Sicker
Oops, sent too soon. I see that’s a snapshot repo. I believe we need to run CI again since we purged some old snapshots the other day. On Tue, Nov 3, 2020 at 08:23 Matt Sicker wrote: > Snapshots aren’t meant to be in the release repository. While we do > publish snapshots in our snapshots repo f

Re: log4j 3.0.0-SNAHSOPT disappeared

2020-11-03 Thread Matt Sicker
Snapshots aren’t meant to be in the release repository. While we do publish snapshots in our snapshots repo from CI, those aren’t releases, so we don’t directly advertise them except to users who want to test out future changes. I’m not particularly sure why you’ve chosen 3.x as that repo changes m

Re: Log4j Syslog

2019-11-15 Thread Ralph Goers
1. Please not that the paragraph after your signature is meaningless when posting to a publicly archived mailing list such as this one. 2. The pattern attribute needs to be a valid pattern “RFC 5424” is not a valid pattern. I would assume that you really should have specified layout.type=RFC542

Re: Log4j 2.10 / slf4j 1.8 icw OSGI/Eclipse

2018-03-30 Thread Rob Gansevles
Hi Ralph, I have a simple osgi plugin that just logs something to slf4j Logger in the Activator's bundle start method. When I install and start log4j-core-2.11.0.jar, log4j-api-2.11.0.jar, log4j-slf4j-impl-2.11.0.jar and slf4j-api-1.8.0-beta1.jar in a clean felix gogo shell, and then install and s

Re: Log4j 2.10 / slf4j 1.8 icw OSGI/Eclipse

2018-02-21 Thread Ralph Goers
We have some unit tests that run to test our OSGi support and they are all passing. I don’t have anything that uses OSGi but I suppose if I can find a sample project I could give it a whirl. I just don’t know when. Between work and the other things I am trying to do for logging I don’t have much

Re: Log4j 2.10 / slf4j 1.8 icw OSGI/Eclipse

2018-02-21 Thread Rob Gansevles
Ralph, Do you think that release 2.10 broke OSGI support? Maybe you can try it out if you have time. It could be that the manifest has to be modified as described here: http://aries.apache.org/modules/spi-fly.html#specconf In that case i guess slf4j also needs to be changed. Rob On Wed, Feb 21

Re: Log4j 2.10 / slf4j 1.8 icw OSGI/Eclipse

2018-02-20 Thread Ralph Goers
I implemented the bindings for SLF4J 1.8 and they are in 2.10.0 but I have never tried it with OSGi. Ralph > On Feb 20, 2018, at 12:47 PM, Rob Gansevles wrote: > > Hi, > > I am trying to get Log4j 2.10 with slf4j 1.8 working in my eclipse plugin > project. > > Slf4j 1.8 does not use the Stat

Re: Log4j Migration from 1.x to 2.x

2017-12-19 Thread Ralph Goers
According to https://logging.apache.org/log4j/1.2/apidocs/org/apache/log4j/helpers/LogLog.html that class is used to log stuff internal to Log4j. Log4j 2 uses the StatusLogger for this. StatusLogger uses the Lo

Re: Log4j Migration from 1.x to 2.x

2017-12-19 Thread Matt Sicker
Is LogLog just an event logger? There's a new EventLogger API that lets you log generic events. Another option might be to use Lombok and add @Log4j2 to your class to get a logger field automatically. On 19 December 2017 at 17:29, Praveen Kumar Gunasekaran < praveenkumarg...@gmail.com> wrote: >

Re: Log4j Migration from 1.x to 2.x

2017-12-19 Thread Praveen Kumar Gunasekaran
Ralph, Sure. One of the examples that i can give as of now is for LogLog class. We use LogLog class for exception handling. For any issues thrown during the logic, we catch the exception and throw the error using LogLog like below, LogLog.error( "The error thrown during the p

Re: Log4j Migration from 1.x to 2.x

2017-12-19 Thread Ralph Goers
I will give the same answer I gave to another user just last week. You are better off telling us what you are trying to achieve then asking questions like below. Log4j 2 works very differently than Log4j 1 and has more capabilities built in. It is better to take advantage of that then simply tr

Re: log4j reduction of repeated message

2017-12-13 Thread Remko Popma
I believe this is possible, but it’s not trivial. See the discussion here: https://issues.apache.org/jira/browse/LOG4J2-1630 (Shameless plug) Every java main() method deserves http://picocli.info > On Dec 14, 2017, at 2:18, Carlos Terron Bueno wrote: > > rsyslog has an option, > $RepeatedMsgR

Re: Log4j Stacktrace - Only have certain lines in stacktrace

2017-12-11 Thread Ralph Goers
If you look at the documentation for the %ex pattern of the PatternLayout [1] you will see that you can do the exact opposite. You can specify packages that you don’t want to see. Ralph [1] http://logging.apache.org/log4j/2.x/manual/layouts.html#PatternLayout

Re: Log4j Stacktrace - Only have certain lines in stacktrace

2017-12-11 Thread Mikael Ståldal
On 2017-12-02 16:01, Debraj Manna wrote: In my stacktrace I only want to have lines starting with let's say com.xyz. Is it possible to have something like the solution discussed in this answer ? As far as I know, it is currently not possible to do t

Re: log4j vs log4jextras v1.x

2017-11-17 Thread Remko Popma
Not sure, you’d have to try. But be aware that Log4j 1.2 has been End of Life for 2 years now and is known to be broken on Java 9. We recommend everyone to upgrade to Log4j2. Log4j2 has better performance and can be configured to be garbage free. Just switching to Log4j2 is likely to speed u

Re: log4j vs log4jextras v1.x

2017-11-17 Thread Alex O'Ree
Understood, but if I needed log4extras, would I just have just log4extras on the classpath or (log4jextras and log4j) on the classpath On Nov 17, 2017 1:36 PM, "Ralph Goers" wrote: > Log4jextras was extra stuff for Log4j 1. Log4j 1 is not longer supported > so neither would be log4jextras. > >

Re: log4j vs log4jextras v1.x

2017-11-17 Thread Ralph Goers
Log4jextras was extra stuff for Log4j 1. Log4j 1 is not longer supported so neither would be log4jextras. Ralph > On Nov 17, 2017, at 11:22 AM, Alex O'Ree wrote: > > Sorry if this has been asked before, but i'm not clear on whether or not > log4jextras is a replacement for log4j or an add on?

Re: Log4j and Java 9 JPMS support

2017-09-18 Thread Ralph Goers
Actually, you are asking for a log file per module. That shouldn’t require a new ContextSelector. That would only be required if you wanted to have a separate configuration for each module. Right now Log4j doesn’t do anything to identify what module a class is located in. That would be required

Re: Log4j and Java 9 JPMS support

2017-09-18 Thread Ralph Goers
Right now LoggerContexts are organized around ClassLoaders. We haven’t even talked about creating a ModuleContextSelector. If you want to help contribute towards that it would be welcome. Ralph > On Sep 18, 2017, at 1:18 AM, Alex Sviridov > wrote: > > Hi all > > Could anyone say if log4j 1/

Re: [log4j 1.x] Batch-sending with SMTPAppender

2016-11-30 Thread Remko Popma
Details are here: https://blogs.apache.org/logging/entry/moving_on_to_log4j_2 Sent from my iPhone > On 1 Dec 2016, at 10:32, Christopher Schultz > wrote: > > Remko, > >> On 11/30/16 5:26 PM, Remko Popma wrote: >> Chris, >> >> Glad to hear that. >> >> Be aware that Log4j 1 is broken in Java

Re: [log4j 1.x] Batch-sending with SMTPAppender

2016-11-30 Thread Christopher Schultz
Remko, On 11/30/16 5:26 PM, Remko Popma wrote: > Chris, > > Glad to hear that. > > Be aware that Log4j 1 is broken in Java 9 so you will need to go to > Log4j 2 when you upgrade Java. I'm curious... in what way is log4j 1.x broken in Java 9? I've been meaning to switch to log4j 2.x for a numb

Re: [log4j 1.x] Batch-sending with SMTPAppender

2016-11-30 Thread Remko Popma
Chris, Glad to hear that. Be aware that Log4j 1 is broken in Java 9 so you will need to go to Log4j 2 when you upgrade Java. Remko Sent from my iPhone > On 1 Dec 2016, at 1:41, Christopher Schultz > wrote: > > All, > > On 11/17/16 10:28 AM, Christopher Schultz wrote: >>> So, I implement

Re: [log4j 1.x] Batch-sending with SMTPAppender

2016-11-30 Thread Christopher Schultz
All, On 11/17/16 10:28 AM, Christopher Schultz wrote: >> So, I implemented an event trigger class in my driver class like this: >> >> package com.my; >> public class Driver >> { >> [...] >> public static class NeverTriggeringEventEvaluator >> implements TriggeringEventEvaluator >>

Re: [log4j 1.x] Batch-sending with SMTPAppender

2016-11-17 Thread Christopher Schultz
All, On 11/17/16 10:20 AM, Christopher Schultz wrote: > All, > > On 11/16/16 5:33 PM, Christopher Schultz wrote: >> Scott, >> >> On 11/16/16 2:09 PM, Scott Harrington wrote: > On 11/16/16 9:49 AM, Ralph Goers wrote: >> First, I have to say that Log4j 1 reached end-of-life over a year

Re: [log4j 1.x] Batch-sending with SMTPAppender

2016-11-17 Thread Christopher Schultz
All, On 11/16/16 5:33 PM, Christopher Schultz wrote: > Scott, > > On 11/16/16 2:09 PM, Scott Harrington wrote: On 11/16/16 9:49 AM, Ralph Goers wrote: > First, I have to say that Log4j 1 reached end-of-life over a year > ago. We recommend you upgrade to Log4j 2. Fair enough

Re: [log4j 1.x] Batch-sending with SMTPAppender

2016-11-16 Thread Gary Gregory
You might not even need to change the configuration if you use the "org.apache.log4j.config" package in the "log4j-1.2-api" module , which is not well documented, yet. Gary On Wed, Nov 16, 2016 at 3:36 PM, Remko Popma wrote: > Chris, > > Are you aware that there is a log4j-1.2-api adapter inclu

Re: [log4j 1.x] Batch-sending with SMTPAppender

2016-11-16 Thread Remko Popma
Chris, Are you aware that there is a log4j-1.2-api adapter included in Log4j2 that allows you to keep your application code unchanged (unless you rely on the innards of Log4j 1.2)? You only need to change the configuration (the manual has tons of examples). Just FYI. Remko Sent from my iPho

Re: [log4j 1.x] Batch-sending with SMTPAppender

2016-11-16 Thread Gary Gregory
If you do look at Log4j2 it would be great if you could give us feedback on what is missing for your use case. I or others can help turn things around quickly to make Log4j 2 even better. Gary On Nov 16, 2016 2:33 PM, "Christopher Schultz" wrote: > Scott, > > On 11/16/16 2:09 PM, Scott Harringt

Re: [log4j 1.x] Batch-sending with SMTPAppender

2016-11-16 Thread Christopher Schultz
Scott, On 11/16/16 2:09 PM, Scott Harrington wrote: >>> On 11/16/16 9:49 AM, Ralph Goers wrote: First, I have to say that Log4j 1 reached end-of-life over a year ago. We recommend you upgrade to Log4j 2. >>> >>> Fair enough. I'm not quite there, yet. I suspect that log4j 2 will have >>>

Re: [log4j 1.x] Batch-sending with SMTPAppender

2016-11-16 Thread Scott Harrington
On 11/16/16 9:49 AM, Ralph Goers wrote: First, I have to say that Log4j 1 reached end-of-life over a year ago. We recommend you upgrade to Log4j 2. Fair enough. I'm not quite there, yet. I suspect that log4j 2 will have the same issue, though. I don’t know how to configure a TriggeringEventEv

Re: [log4j 1.x] Batch-sending with SMTPAppender

2016-11-16 Thread Ralph Goers
> On Nov 16, 2016, at 10:11 AM, Christopher Schultz > wrote: > > Ralph, > > On 11/16/16 9:49 AM, Ralph Goers wrote: >> First, I have to say that Log4j 1 reached end-of-life over a year >> ago. We recommend you upgrade to Log4j 2. > > Fair enough. I'm not quite there, yet. I suspect that log4j

Re: [log4j 1.x] Batch-sending with SMTPAppender

2016-11-16 Thread Gary Gregory
You might have to use an XML configuration file to get that to work in Log4j 1: See org.apache.log4j.net.SMTPAppenderTest.testTrigger() Gary On Wed, Nov 16, 2016 at 9:11 AM, Christopher Schultz < ch...@christopherschultz.net> wrote: > Ralph, > > On 11/16/16 9:49 AM, Ralph Goers wrote: > > First,

Re: [log4j 1.x] Batch-sending with SMTPAppender

2016-11-16 Thread Christopher Schultz
Ralph, On 11/16/16 9:49 AM, Ralph Goers wrote: > First, I have to say that Log4j 1 reached end-of-life over a year > ago. We recommend you upgrade to Log4j 2. Fair enough. I'm not quite there, yet. I suspect that log4j 2 will have the same issue, though. > I don’t know what you mean by “each log

Re: [log4j 1.x] Batch-sending with SMTPAppender

2016-11-16 Thread Ralph Goers
First, I have to say that Log4j 1 reached end-of-life over a year ago. We recommend you upgrade to Log4j 2. I don’t know what you mean by “each log message seems to generate its own separate email message”. The SMTP appender accumulates log events in a buffer until a triggering event occurs (us

Re: Log4J 2.5 -> 2.6 Upgrade NoSuchMethodError

2016-05-31 Thread DiFrango, Ronald
Thanks…found it and switching over to it now. Ron DiFrango On 5/31/16, 4:44 PM, "Paul Benedict" wrote: >Refer to the Bill of Material section (BOM) here: >https://logging.apache.org/log4j/2.x/maven-artifacts.html > >Cheers, >Paul > >On Tue, May 31, 2016 at 3:41 PM, DiFrango, Ronald < >ron

Re: Log4J 2.5 -> 2.6 Upgrade NoSuchMethodError

2016-05-31 Thread Paul Benedict
Refer to the Bill of Material section (BOM) here: https://logging.apache.org/log4j/2.x/maven-artifacts.html Cheers, Paul On Tue, May 31, 2016 at 3:41 PM, DiFrango, Ronald < ronald.difra...@capitalone.com> wrote: > Paul, > > > I hadn’t seen that before, that would be great! > > Ron DiFrango > > >

Re: Log4J 2.5 -> 2.6 Upgrade NoSuchMethodError

2016-05-31 Thread DiFrango, Ronald
Paul, I hadn’t seen that before, that would be great! Ron DiFrango On 5/31/16, 4:39 PM, "Paul Benedict" wrote: >DiFrango, log4j includes a BOM you may want to consider using. This will >keep all your log4j artifacts versioned the same. > >Cheers, >Paul > >On Tue, May 31, 2016 at 3:37

Re: Log4J 2.5 -> 2.6 Upgrade NoSuchMethodError

2016-05-31 Thread Paul Benedict
DiFrango, log4j includes a BOM you may want to consider using. This will keep all your log4j artifacts versioned the same. Cheers, Paul On Tue, May 31, 2016 at 3:37 PM, DiFrango, Ronald < ronald.difra...@capitalone.com> wrote: > Gary, > > It ended up being a transitive dependency conflict, one o

Re: Log4J 2.5 -> 2.6 Upgrade NoSuchMethodError

2016-05-31 Thread DiFrango, Ronald
Gary, It ended up being a transitive dependency conflict, one of the included libraries had 2.5. Ron DiFrango On 5/31/16, 3:38 PM, "DiFrango, Ronald" wrote: >Gary, > >I did a full clean and install via Maven, but I’ll double check the >dependencies. > >Thanks, > >Ron > > > > > > > >

Re: Log4J 2.5 -> 2.6 Upgrade NoSuchMethodError

2016-05-31 Thread DiFrango, Ronald
Gary, I did a full clean and install via Maven, but I’ll double check the dependencies. Thanks, Ron On 5/31/16, 3:35 PM, "Gary Gregory" wrote: >On Tue, May 31, 2016 at 11:42 AM, DiFrango, Ronald < >ronald.difra...@capitalone.com> wrote: > >> All, >> >> I just attempted to upgrade fro

Re: Log4J 2.5 -> 2.6 Upgrade NoSuchMethodError

2016-05-31 Thread Gary Gregory
On Tue, May 31, 2016 at 11:42 AM, DiFrango, Ronald < ronald.difra...@capitalone.com> wrote: > All, > > I just attempted to upgrade from log42j version 2.5 to 2.6 and I started > getting the following: > > java.lang.NoSuchMethodError: > org.apache.logging.log4j.Logger.debug(Ljava/lang/String;Ljava/

Re: Log4J 2 configuration: parameterizing appender via environment variable

2016-02-10 Thread Ralph Goers
I was actually thinking that we might create a lookup that parses the results from other lookups. I’m just not sure what the syntax would be. Ralph > On Feb 10, 2016, at 2:49 PM, Gary Gregory wrote: > > It sounds like a pretty generic feature though. And making life easier for > log4j1 migrat

Re: Log4J 2 configuration: parameterizing appender via environment variable

2016-02-10 Thread Gary Gregory
It sounds like a pretty generic feature though. And making life easier for log4j1 migratory users is a huge bonus IMO. How about contributing this as a patch? Gary On Feb 10, 2016 1:32 PM, "Ralph Goers" wrote: > Yes, they are discrete attributes in Log4j2. However, you should be able > to handl

  1   2   3   4   5   6   7   8   9   10   >