***UNCHECKED*** Re: [External] How to encode %m or %ex ?

2018-01-26 Thread Ralph Goers
>>>false> alwaysWriteExceptions> >>>>%level;%d{yyyy-MM-dd >>> HH:mm:ss.SSS};%t;%c;%encode{% >>>> m}{JSON}%n >>>> >>>> >>>> Any hints how to use the %encode method to get JSON or CRLF >> encoding? >>>&

Re: log event pojo from log file/ parse file back to log event

2018-02-02 Thread Ralph Goers
You would want to create an Appender that publishes to registered listeners. Log4j currently doesn’t have one but it would be pretty simple to create one. Ralph > On Feb 2, 2018, at 6:09 AM, Tushar Kapila wrote: > > Am sure this has been asked before but i could not find

Re: log event pojo from log file/ parse file back to log event

2018-02-02 Thread Ralph Goers
Actually I should clarify this a bit. Log4j does have Appenders that will write to Kafka or similar frameworks, but I am gathering from what you asked for that you want something that is entirely in the application. Ralph > On Feb 2, 2018, at 2:58 PM, Ralph Goers <ralph.go...@dslextre

Re: reusing a logger+appender

2018-02-07 Thread Ralph Goers
Are you saying you want to merge a new configuration with the existing one? Log4j supports a composite configuration but the files that make up the composite have to be known from the beginning. Ralph > On Feb 7, 2018, at 6:22 PM, Benjamin Jaton wrote: > > I am

Re: Programmatically Modifying the Current Configuration after Initialization

2018-02-08 Thread Ralph Goers
If you want to replace the existing configuration you should be able to do: Configurator.initialize(“MyApp”, “app-log4j2.xml”); This will look for a file named app-log4j2.xml on the class path. Ralph > On Feb 8, 2018, at 1:28 PM, Mike Kienenberger wrote: > > As others

Re: Programmatically Modifying the Current Configuration after Initialization

2018-02-09 Thread Ralph Goers
Volker, It looks like Configurator.setLevel(String loggerName, Level level) will do the same thing as the code below. Ralph > On Feb 9, 2018, at 1:21 AM, Volker Weber wrote: > > Hi Mike, > > in our app we implemented a REST-Service to reconfigure log4j2 at runtime. > >

Re: Programmatically Modifying the Current Configuration after Initialization

2018-02-09 Thread Ralph Goers
let. :) > > Ok. I'll back to programmically registering info read from my > XmlConfiguration into the active Context. > > On Fri, Feb 9, 2018 at 11:12 AM, Ralph Goers <ralph.go...@dslextreme.com> > wrote: >> It occurs to me that there is a problem with my suggest in t

Re: Programmatically Modifying the Current Configuration after Initialization

2018-02-09 Thread Ralph Goers
018, at 9:08 AM, Ralph Goers <ralph.go...@dslextreme.com> wrote: > > If you want to add to their configuration then you should use a > CompositeConfiguration. In that case I would get the current configuration, > create your own Configuration, add them both to a new C

Re: Programmatically Modifying the Current Configuration after Initialization

2018-02-09 Thread Ralph Goers
r own changes to it. I can > see how this will be helpful when I'm doing development in this > environment. But it doesn't meet the need of only changing logging so > that our own module logs to a different location. > > On Thu, Feb 8, 2018 at 7:26 PM, Ralph Goers <ralph.g

Re: Programmatically Modifying the Current Configuration after Initialization

2018-02-09 Thread Ralph Goers
= ConfigurationFactory.getInstance().getConfiguration(context, source); } If getConfigurationSource returns null it would normally mean it wasn’t configured from a file. This solution wouldn’t handle that case but from what you have asked for this should be good enough. Ralph > On Feb 9, 2018, at 10:37 AM, Ralph Go

Re: Programmatically Modifying the Current Configuration after Initialization

2018-02-09 Thread Ralph Goers
#SystemProperties <http://logging.apache.org/log4j/2.x/manual/configuration.html#SystemProperties> is incorrect. log4j2.mergeFactory will not work. Ralph > On Feb 9, 2018, at 5:06 PM, Ralph Goers <ralph.go...@dslextreme.com> wrote: > > CompositeConfiguration tries to merge at

Re: Programmatically Modifying the Current Configuration after Initialization

2018-02-09 Thread Ralph Goers
make the cloned existing > configuration the last one added in order to preserve the root logger > from EVIL.jar? > > > > On Fri, Feb 9, 2018 at 4:50 PM, Ralph Goers <ralph.go...@dslextreme.com> > wrote: >> You are starting the local configuration. This is a bit

Re: Programmatically Modifying the Current Configuration after Initialization

2018-02-09 Thread Ralph Goers
; > //parentLoggerConfig = localRootLoggerConfig; > // > configuration.addLogger(localRootLoggerConfig.getName(), > localRootLoggerConfig); > //} > >for (LoggerConfig newLoggerConfig : newLoggerConfigList) >{ >

Re: Best approach for sub-millisecond timestamps?

2018-02-10 Thread Ralph Goers
See https://issues.apache.org/jira/browse/LOG4J2-1883 Ralph > On Feb 10, 2018, at 10:42 AM, alfred.eckm...@gmx.com wrote: > > Hello list, > > I need to get more granular timestamps in my logs. > > The question is what is the best way get

Re: reusing a logger+appender

2018-02-14 Thread Ralph Goers
ed/necessary. > Also defining appenders "just in case" they might be used is sometimes not > ideal, as some appenders issue connections requests or create resources on > creation. > > Benjamin > > On Wed, Feb 7, 2018 at 8:53 PM, Ralph Goers <ralph.go...@dslextreme

Re: Log4j2 v2.10.0 and Java 8 support?

2018-02-20 Thread Ralph Goers
The Java 9 module support is still fairly new. We have had reports that it is still rough around the edges. Ralph > On Feb 20, 2018, at 3:06 PM, Matt Sicker wrote: > > Log4j 2.10 still requires Java 7. We're planning to require Java 8 only in > Log4j 3.x. The Java 9 support

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

Re: Log4j 2.10 / slf4j 1.8 icw OSGI/Eclipse

2018-02-21 Thread Ralph Goers
he 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, 2018 at 2:12 AM, Ralph Goers <ralph.go...@dslextreme.com> > wrote: > >>

Re: Parametrizing file names with start date of process

2018-02-24 Thread Ralph Goers
First, you are referring to the variable as %{now} when it should be ${now}. Second, all that is going to do is replace ${now} in the file name with %d{-MM-dd} which will then be resolved when the file is created. I would suggest defining now as ${date:-MM-dd} Ralph > On Feb 24,

Re: Migrating from log4j1 to log4j2

2017-12-21 Thread Ralph Goers
? Are you wanting those >> changes re-applied after a reconfiguration?" >> We had log level set to null so that when we reloaded the file it would >> add back the loggers. But it wouldn't get rid of any appenders which we set >> through java. >> >> We are t

Re: How to build the Routing Appender with the ConfigurationBuilder

2017-12-21 Thread Ralph Goers
eve this to be a bug?. > > Cheers Jens > > > > Am 27.11.2017 um 18:36 schrieb Ralph Goers: >> What you need to know is that with the ConfigurationBuilder everything is >> really a Component. Since Layouts, Appenders, Filters and Loggers are so >> common we

Re: Do we need two leading $ signs for lookups inside XML elements and one $ inside XML attributes?

2018-01-03 Thread Ralph Goers
When the configuration is read all variables are resolved, so every variable with a single $ will be replaced with its value. When a variable needs to be resolved at run time you must use 2 $ characters. The first will be stripped off leaving the variable reference. That property will then be

Re: Parametrizing file names with start date of process

2018-02-24 Thread Ralph Goers
my config file and > accidentally changed $ to %. It is correct in the file. I tried > ${date:-MM-dd} and it works. I'll read up on what "date:" is. > > Thank you, > Laurent > > -Original Message- > From: Ralph Goers [mailto:ralph.go...@dslextrem

Re: Strange results using Apache Ivy

2018-07-27 Thread Ralph Goers
There is no way Log4j would be doing anything that would cause log4j-1.2.17.jar to be included. Almost certainly one of your other dependencies is pulling it in as a transitive dependency. You shouldn’t need to declare log4j-api as log4j-core will cause it to be included as a transitive

[ANNOUNCE] Apache Log4j 2.11.1 released

2018-07-30 Thread Ralph Goers
The Apache Log4j 2 team is pleased to announce the Log4j 2.11.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

Re: Release versions of log4j-server artifact in maven central?

2018-07-26 Thread Ralph Goers
A version will be released. It is on my to-do list. Ralph > On Jul 26, 2018, at 11:52 AM, Gary Hodgson wrote: > > Hi Gary, > > For the time being staying on 2.8.2 is fine for us, particularly if we know > that a version will be released at some stage in the future. > > Cheers, > Gary > > On

Re: log4j2 under OSGi application

2018-07-25 Thread Ralph Goers
The default context selector is ClassLoaderContextSelector which creates a LoggerContext for each ClassLoader. This means that if you were to start and stop a bundle the Logging environment for that bundle should clean up. When you use the BasicContextSelector there is only a single

Re: Multiple Applications writing to same log file

2018-08-10 Thread Ralph Goers
You can have multiple applications write to the same log file if you use file locking, otherwise your log file is likely to get corrupted. The RollingFileAppender does not support file locking as it is not possible, or at least very difficult, to have multiple applications try to safely roll

Re: Multiple Applications writing to same log file

2018-08-10 Thread Ralph Goers
I realize I misread the question. Yes, two web applications running in the same JVM can write to the same log file. If there is only one instance of log4j in the JVM then you should be able to safely use the RollingFileAppender. Ralph > On Aug 10, 2018, at 7:38 AM, Ralph Goers wrote: >

Re: Changing %c logger abbrevation - can't figure out how to achieve what I'm after

2018-08-07 Thread Ralph Goers
You want to look at the NameAbbreviator class. It has sub-classes that perform the various styles of abbreviation. Logback also has a name abbreviator where you specify a max length. Basically, the algorithm is, a) always print the full class name, b) if the length is large enough to contain

Re: Changing xml config file after startup

2018-08-14 Thread Ralph Goers
You are simply trying to refresh the configuration from the same location? Ralph > On Aug 14, 2018, at 8:35 AM, John Lussmyer wrote: > > Our (old) code that uses log4j does the following in order to swap xml > configurations after app initialization. > > final

Re: Changing xml config file after startup

2018-08-14 Thread Ralph Goers
as Configurator.reconfigure(); If that is what you want please create a Jira issue and summarize this there. Ralph > On Aug 14, 2018, at 9:14 AM, Ralph Goers wrote: > > You are simply trying to refresh the configuration from the same location? > > Ralph > >> On Aug 14

Re: [External] Get thrown_name from JSON appender in RollingRandomAccessFile appender

2018-08-14 Thread Ralph Goers
Is there a reason why you cannot use $ex{short.className} in your pattern? Ralph > On Aug 14, 2018, at 2:21 PM, Matt Sicker wrote: > > Sounds like a new feature then. Please file a JIRA ticket. PRs welcome! > > On Tue, 14 Aug 2018 at 01:53, Fröstl, Christian < >

Re: [External] Log4j2 - combining .properties and .xml config files

2018-08-16 Thread Ralph Goers
gt;/local-55.properties > log4j.configurationFile=/path-to-file>/local-55.properties > > Greetings, > Christian > > On 06.08.18, 15:26, "Ralph Goers" <mailto:ralph.go...@dslextreme.com>> wrote: > >You can do this today. See

Re: Wrong Exports and Automatic Module Name

2018-08-09 Thread Ralph Goers
9c64/jfxtras-common-9.0-r1.jar(/module-info.class)] >> [loading >> /home/djviking/.gradle/caches/modules-2/files-2.1/org.jfxtras/jfxtras-fxml/9.0-r1/dfd376482bee9a70532f35f97881a8d7785e1e02/jfxtras-fxml-9.0-r1.jar(/module-info.class)] >> [loading >> /home/djviking/.gradle/caches/

Re: Problem with daily rotation on log4j2 RollingFile

2018-08-24 Thread Ralph Goers
nd that with such a high > concurrency I have it's better to use RollingRandomFile. > > Thanks, > Joan. > > -----Mensaje original- > De: Ralph Goers [mailto:ralph.go...@dslextreme.com] > Enviado el: viernes, 24 de agosto de 2018 19:18 > Para: Log4J Users List

Re: Problem with daily rotation on log4j2 RollingFile

2018-08-24 Thread Ralph Goers
The TimeBasedTriggeringPolicy does not check for rollover on every log event to reduce the overhead on busy systems. When you are only logging a few events you will see it log a few records to the prior file before it checks for a rollover. In your case you would be better off using the

Re: Problem with daily rotation on log4j2 RollingFile

2018-08-24 Thread Ralph Goers
Matt, I don’t see anything wrong with the file pattern. Ralph > On Aug 24, 2018, at 10:18 AM, Matt Sicker wrote: > > I don't think your filePattern value is correct. You should be using format > specifiers from SimpleDateFormat there, not PatternLayout. Or you could put > the date in a $${} to

Re: Problem with daily rotation on log4j2 RollingFile

2018-08-24 Thread Ralph Goers
018-08-26? > > Thanks, > > Joan. > > -Mensaje original- > De: Ralph Goers [mailto:ralph.go...@dslextreme.com] > Enviado el: viernes, 24 de agosto de 2018 19:24 > Para: Log4J Users List > Asunto: Re: Problem with daily rotation on log4j2 RollingFile > > Matt, I don’t

Re: Problem with daily rotation on log4j2 RollingFile

2018-08-24 Thread Ralph Goers
ile: java.lang.IllegalStateException: Pattern does not contain a date > java.lang.IllegalStateException: Pattern does not contain a date > > Obviously there is something here I don't understand. What should I use in > filePattern to get the daily rotation working? > > Thanks again, > Joan > >

Re: Problem with daily rotation on log4j2 RollingFile

2018-08-24 Thread Ralph Goers
of the file name but won’t impact the rollover interval. Ralph > On Aug 24, 2018, at 12:43 PM, Joan Balagueró - ventusproxy > wrote: > > Sorry, is the pattern ok or not? Thanks, Joan. > > -Mensaje original- > De: Ralph Goers [mailto:ralph.go...@dslextreme.com] > En

Re: Problem with daily rotation on log4j2 RollingFile

2018-08-24 Thread Ralph Goers
I should update the manual so I stop > confusing myself every time a question about rolling files comes up. > > On Fri, Aug 24, 2018 at 19:25, Ralph Goers > wrote: > >> That problem is because your original pattern was correct. >> >> Ralph >> >>>

Re: Problem with daily rotation on log4j2 RollingFile

2018-09-05 Thread Ralph Goers
21 > > > There are 35ms between the last line of 2018-09-05 (23:59:59.976) and the > first line of 2018-09-06 (00:00:00.011). I think it's too much time for not > having some requests within this interval. > > Is it possible that log lines coming exactly when the rotation is occurring >

Re: Odd problem starting program with log4j2 on Windows

2018-07-05 Thread Ralph Goers
I have updated the issue you referenced. From what I can tell this is not an issue in Log4j. It is an issue with the way file urls work. Ralph > On Jul 5, 2018, at 9:05 AM, Shawn Heisey wrote: > > On 7/3/2018 4:59 PM, Ralph Goers wrote: >> Also - Since %DEFAULT_SERVER_DI

Re: Odd problem starting program with log4j2 on Windows

2018-07-05 Thread Ralph Goers
lating the input string that was provided to us, but we are trying any way we can to convert it into some sort of file we can access. If you see something missing in this logic please let us know. Ralph > On Jul 5, 2018, at 1:59 PM, Shawn Heisey wrote: > > On 7/5/2018 11:38 AM, Ra

Re: Odd problem starting program with log4j2 on Windows

2018-07-05 Thread Ralph Goers
6, 2018, at 10:52, Gary Gregory wrote: >> >> Can't URL contain commas? >> >> Gary >> >>> On Thu, Jul 5, 2018, 18:11 Ralph Goers wrote: >>> >>> Here is what Log4j does: >>> >>> If the property is specified first see if it c

Re: Odd problem starting program with log4j2 on Windows

2018-07-05 Thread Ralph Goers
I suppose we could look for that and fix it, but that would mean having Windows specific code. Ralph > On Jul 5, 2018, at 9:10 PM, Ralph Goers wrote: > > So that is some weirdness with Java itself, and only on Windows. > > Ralph > >> On Jul 5, 2018, at 7:34 PM, Remk

Re: How to specify a log4j2.xml config file outside from classpath?

2018-01-24 Thread Ralph Goers
I’d have to look at the code to be sure, but you might try configuring it as a url - file:///mypath . Ralph > On Jan 24, 2018, at 5:46 AM, Fröstl, Christian > wrote: > > Hello everybody, > > We like to use a log4j2.xml file for log4j2 configuration of our

Re: Target date for 2.11 release?

2018-03-07 Thread Ralph Goers
Yes, I am currently working through issues that are preventing me from performing the release. Ralph > On Mar 7, 2018, at 8:27 AM, Rodrigo Merino > wrote: > > Hi, > > I would like to know if there are any plans for releasing 2.11 in the short > term. > > In

Re: Need to clear ThreadContext for each HTTP request?

2018-04-17 Thread Ralph Goers
is a quite common thing. But that >> was just my assumption. I agree that it's better to *clear explicitly*. >> >> Thanks, >> Kevin >> >> On Mon, Apr 16, 2018 at 8:32 PM, Ralph Goers <ralph.go...@dslextreme.com> >> wrote: >> >>> See

Re: Need to clear ThreadContext for each HTTP request?

2018-04-16 Thread Ralph Goers
See the example at http://logging.apache.org/log4j/2.x/manual/eventlogging.html . You will see the call to clear the ThreadContext. It does indeed use a filter. Ralph > On Apr 16, 2018, at 7:01 PM, Kevin Jung

Re: Configure appender from database

2018-03-29 Thread Ralph Goers
Will a database configuration could certainly be supported somehow, any changes to it would most likely still end up in a full reconfiguration as that is how Log4j generally handles changes to the configuration it detects. Ralph > On Mar 29, 2018, at 8:29 AM, Enric Jaen

Re: Integration of stacktraceAsString in JSONLayout

2018-03-16 Thread Ralph Goers
That feature looks like it was introduced with LOG4J2-1923. That issue as marked as being fixed in Log4j 2.9.0. Unfortunately, I don’t see that issue in the manual change log so whoever committed it must have missed documenting it there. Ralph > On Mar 16, 2018, at 7:56 AM, Fröstl, Christian

Re: [ANNOUNCE] Apache Log4j 2.11.0 released

2018-03-16 Thread Ralph Goers
Please ignore the email below. It contains incorrect text regarding the release. Ralph > On Mar 16, 2018, at 5:39 PM, Ralph Goers <ralph.go...@dslextreme.com> wrote: > > The Apache Log4j 2 team is pleased to announce the Log4j 2.10.0 release! > > Apache Log4j is a

Re: Flush in RollingRandomAccessFile

2018-09-27 Thread Ralph Goers
Are you using the log4j-web jar? It is supposed to handle this. Ralph > On Sep 27, 2018, at 8:14 AM, Joan Balagueró - ventusproxy > wrote: > > Hello, > > > > After sending thousands of requests to our app, we stop the sender and the > log file appears like below: > > > >

Re: Flush in RollingRandomAccessFile

2018-09-27 Thread Ralph Goers
> > After adding the log4j-web-2.11.1.jar to our app, it doesn't work yet. > > Do I need to add something to the web.xml file, or some environment variable? > > Thanks, > > Joan. > > -Mensaje original- > De: Ralph Goers [mailto:ralph.go...@dslextreme.com] &

Re: Using BasicContextSelector in OSGI application

2018-10-05 Thread Ralph Goers
ient > anyways. > > On Thu, 4 Oct 2018 at 16:08, Ralph Goers wrote: > >> Matt, I don’t think that makes a difference when running in OSGi. The >> problem is that core is calling API and asking it to load a core class. >> Unless it has access to the class it can’t

Re: Using BasicContextSelector in OSGI application

2018-10-04 Thread Ralph Goers
att Sicker wrote: > > LoaderUtil is using the thread context class loader by default. If it's not > set right, you can use of the methods there to specify the correct > ClassLoader, or you can even push and pop TCCLs essentially. > > On Wed, 3 Oct 2018 at 16:46, Ralph Goers wrote

Re: Using BasicContextSelector in OSGI application

2018-10-03 Thread Ralph Goers
; LoaderUtil). > > What do you think, would this be a good idea instead and remove all > dependencies from log4j-api to log4j-core? > > Rob > > > > > > > > > > > > On Fri, Sep 28, 2018 at 7:38 PM Ralph Goers > wrote: > >

Re: Rolled logs are sometimes empty

2018-10-02 Thread Ralph Goers
While I don’t see anything technically wrong with your configuration you could probably simplify it. If all statistics are produced using the com.myapp.EventStatistics logger you can add additivity=“false” to that logger to prevent the events form also being handled by the root logger. I would

Re: Rolled logs are sometimes empty

2018-10-03 Thread Ralph Goers
users have had similar issues with async logging? > > Thanks. > > On Tue, Oct 2, 2018 at 9:30 AM Ralph Goers > wrote: > >> While I don’t see anything technically wrong with your configuration you >> could probably simplify it. If all statistics are produced using th

Re: Using BasicContextSelector in OSGI application

2018-10-07 Thread Ralph Goers
Thread.currentThread().setContextClassLoader(contextClassLoader); >} >} > } > > > On Fri, Oct 5, 2018 at 9:47 PM Ralph Goers > wrote: > >> If you are explicitly passing around ClassLoaders then it would probably >> work correctly. But here we have M

Re: Have a patch to contribute to fix a lookup issue in Log4j 2

2018-09-26 Thread Ralph Goers
If you have a fix the easiest thing to do is to create a pull request at GitHub. If it has a unit test to validate the problem and the fix it will almost certainly be applied. As far as getting commit rights, that generally happens after someone has contributed several patches, participated to

Re: Flush in RollingRandomAccessFile

2018-09-28 Thread Ralph Goers
t;3.1"> > > ventusproxy > ventusproxy > > >isLog4jContextSelectorNamed >true > > > >log4jContextName >ventusproxy > > > ( ... ) > > Joan. > > > -Mensaje original- > De: Ra

Re: Using BasicContextSelector in OSGI application

2018-09-28 Thread Ralph Goers
All ContextSelectors are part of log4j-core, not log4j-api. Ralph > On Sep 28, 2018, at 7:59 AM, Rob Gansevles wrote: > > Hi, > > I would like to use the BasicContextSelector in our OSGI application so > have a single global log4j connfiguration as described in >

Re: Flush in RollingRandomAccessFile

2018-09-28 Thread Ralph Goers
a:748) > 28-Sep-2018 18:14:37.025 INFORMACIÓN [main] > org.apache.coyote.AbstractProtocol.stop Stopping ProtocolHandler > ["http-nio-80"] > 28-Sep-2018 18:14:37.055 INFORMACIÓN [main] > org.apache.coyote.AbstractProtocol.destroy Destroying ProtocolHandler > ["http-nio-80"] > > Tha

Re: Using BasicContextSelector in OSGI application

2018-09-28 Thread Ralph Goers
der.findClassInternal(BundleLoader.java:466) > at > org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:419) > at > org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:411) > at > org.eclipse.osgi.internal.loader.ModuleClassLoader.loadClas

Re: Using BasicContextSelector in OSGI application

2018-09-28 Thread Ralph Goers
Despite what I said below, it seems that the patch for LOG4J2-920 was applied over 2 years ago so this should not be happening with 2.11.1. Ralph > On Sep 28, 2018, at 10:34 AM, Ralph Goers wrote: > > It sounds related to LOG4J2-920 but the solution provided there has to be &g

[ANNOUNCE] Apache Log4j-Audit 1.0.1 released

2018-12-12 Thread Ralph Goers
The Apache Log4j Audit team is pleased to announce the Log4j Audit 1.0.1 release! Apache Log4j Audit is a framework for performing audit logging using a predefined catalog of audit events. It provides a tool to create and edit audit events. It also provides a REST service to perform the

Re: Regarding log4j2 monitor interval

2018-12-21 Thread Ralph Goers
If you haven’t created a Jira issue for this please do. I need to make modifications to the current file watching logic as I need to be able to monitor configurations external to the application, such as in Spring cloud or possibly even in a git repo. It may be that we will want to add a list

Re: Problem with log4j2.configurationFile. Using log4j2.properties with custom file name.

2018-12-05 Thread Ralph Goers
Even simpler. Just name the file "log4j2-name.xml” where “name” is the name of the web application. Ralph > On Dec 5, 2018, at 8:23 AM, Ralph Goers wrote: > > From what you are describing I would set log4jConfiguration in your web > application’s web.xml as a context param

Re: Problem with log4j2.configurationFile. Using log4j2.properties with custom file name.

2018-12-05 Thread Ralph Goers
From what you are describing I would set log4jConfiguration in your web application’s web.xml as a context parameter. See http://logging.apache.org/log4j/2.x/manual/webapp.html . Ralph > On Dec 5, 2018, at 7:54 AM, paginas wrote: > >

Re: Log4j2 Kafka application fails application startup

2018-11-26 Thread Ralph Goers
Yes, I can see why that happens. The KafkaManager’s start method would throw an exception that isn’t handled. Normally, just the component should fail not the whole configuration. Since the component is already wired in if it fails to start every attempt to write to it will silently fail. Any

Re: Lohg4j2 Schema Errors

2019-01-03 Thread Ralph Goers
You have specified strict=“true” but then not followed the format required when that attribute is specified. See the example at https://logging.apache.org/log4j/2.x/manual/configuration.html#Configuration_Syntax under the sentence that reads "Below is a sample configuration using the strict

Re: Problem with log4j2.configurationFile. Using log4j2.properties with custom file name.

2018-12-19 Thread Ralph Goers
uration > > > > file:///C:/ > > > > > > > > > name > > > > > > > > > / > > > > > > > > > src > > > > > > > > > /particularName/ > > > > >

Re: How to change the log4j2 log level of a running application without restarting?

2019-04-02 Thread Ralph Goers
There are several ways. If you are using Spring Boot you can use the REST API they provide. If you are using a configuration file just add monitorInterval=n where n is the number of seconds to poll for changes. The configuration will automatically reload if you do that. Finally, as Gary noted

Re: Remote configuration

2019-02-28 Thread Ralph Goers
If it is just a file URL then there is no problem. You can already access a remote file via http - or any other url natively supported by a URLConnection - but you cannot monitor for changes. I am in the process of adding support for Spring Cloud Config which will allow you to access a file

Re: Application Server integration in Tomcat

2019-02-22 Thread Ralph Goers
I am not really clear on what you are trying to achieve so this answer is making some guesses. A typical tomcat deployment will have a boot class loader, the tomcat class loader and each web app will have its own class loader. Tomcat’s logging has to happen using Tomcat’s class loader while

Re: Application Server integration in Tomcat

2019-02-24 Thread Ralph Goers
above makes no sense or there are better ways to get things going, I'd > love to hear it > > Tnx for the help so far! > > Paul > > On 23/02/2019 07:40, Ralph Goers wrote: >> I just noticed that you said you have setenv.sh set to >> CLASSPATH=“$CATALINA_HO

Re: Application Server integration in Tomcat

2019-02-22 Thread Ralph Goers
class is loaded by multiple > classloader > > Maybe it's using the java system classloader cause I'm using log4j-jul (as > log4j-appserver doesn't work)? > > Paul > > On Fri, Feb 22, 2019, 7:27 PM Ralph Goers > wrote: > >> Tomcat’s class loader will be a pare

Re: Application Server integration in Tomcat

2019-02-22 Thread Ralph Goers
FWIW, Looking at the Tomcat 9.0 code I see the same ServiceLoader code as in Tomcat 8.5, so the log4j-appserver code should still work. Ralph > On Feb 22, 2019, at 11:27 AM, Ralph Goers wrote: > > Tomcat’s class loader will be a parent of the web app class loader. That > mea

Re: Application Server integration in Tomcat

2019-02-22 Thread Ralph Goers
hether it actually works. Ralph > On Feb 22, 2019, at 11:45 AM, Ralph Goers wrote: > > FWIW, Looking at the Tomcat 9.0 code I see the same ServiceLoader code as in > Tomcat 8.5, so the log4j-appserver code should still work. > > Ralph > >> On Feb 22, 2019, at 11:27 A

Re: Application Server integration in Tomcat

2019-02-22 Thread Ralph Goers
> causing my issues. > > Paul > > On 22/02/2019 18:43, Ralph Goers wrote: >> I am not really clear on what you are trying to achieve so this answer is >> making some guesses. >> >> A typical tomcat deployment will have a boot class loader, the tomcat clas

Re: Application Server integration in Tomcat

2019-02-22 Thread Ralph Goers
FO o.a.c.AbstractProtocol [main] Starting ProtocolHandler ["http-nio-8080"] 2019-02-22 16:14:44,217 INFO o.a.c.AbstractProtocol [main] Starting ProtocolHandler ["ajp-nio-8009"] 2019-02-22 16:14:44,220 INFO o.a.c.s.Catalina [main] Server startup in [767] milliseconds

Re: Remote configuration

2019-03-01 Thread Ralph Goers
equire a custom watchdog that can handle the S3 > connection for checking the file right? > > Thanks > > El jue., 28 feb. 2019 a las 17:24, Ralph Goers () > escribió: > >> If it is just a file URL then there is no problem. You can already access >> a r

Re: Remote configuration

2019-03-01 Thread Ralph Goers
ngle file hosted in S3 and still get the change monitor feature, but then >> it sounds like it would require a custom watchdog that can handle the S3 >> connection for checking the file right? >> >> Thanks >> >> El jue., 28 feb. 2019 a las 17:24, Ralph Goers (< >&

Re: Application Server integration in Tomcat

2019-02-25 Thread Ralph Goers
/log4j.xml and you should be good to go. > > Dumb question: why bother using log4j for Tomcat server-level logging? > If you want to dump to the console, just configure Tomcat to dump to > the console and forget all this additional work. > > - -chris > >> On 23/0

Re: Application Server integration in Tomcat

2019-02-22 Thread Ralph Goers
I just noticed that you said you have setenv.sh set to CLASSPATH=“$CATALINA_HOME/lib/*” That will find the jars but it won’t find your configuration file. You need to specify CLASSPATH=“$CATALINA_HOME/lib/*:${CATALINA_HOME}/lib” Note that lib is specified twice, once with “/*” after it and

[ANNOUNCE] Apache Log4j 2.11.2 released

2019-02-09 Thread Ralph Goers
The Apache Log4j 2 team is pleased to announce the Log4j 2.11.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

Re: Invoke custom code after RollingFileAppender append()

2019-02-15 Thread Ralph Goers
llover? > > Remko. > > (Shameless plug) Every java main() method deserves http://picocli.info > >> On Feb 15, 2019, at 23:39, Ralph Goers wrote: >> >> I don’t think I understand this requirement. Why couldn’t they just create a >> filter that sends the ema

Re: Invoke custom code after RollingFileAppender append()

2019-02-15 Thread Ralph Goers
n Feb 16, 2019, at 0:54, Remko Popma wrote: >> >> Ralph, >> >> I guess then the question becomes: how can the filter detect that a >> particular event triggered a rollover? >> >> Remko. >> >> (Shameless plug) Every java main() metho

Re: Invoke custom code after RollingFileAppender append()

2019-02-15 Thread Ralph Goers
I don’t think I understand this requirement. Why couldn’t they just create a filter that sends the email. Sure, it won’t be right after the event is logged but so what? Ralph > On Feb 15, 2019, at 7:15 AM, Gary Gregory wrote: > > Maybe we should introduce the ability to inject a custom class

Re: Application Server integration in Tomcat

2019-02-19 Thread Ralph Goers
Were you using Tomcat 8.5 or greater? The instructions on the log4j-appserver page should work if you are using that version of Tomcat. Prior to that you will have to follow Tomcat’s instructions on how to replace the logging framework. Ralph > On Feb 19, 2019, at 9:03 AM, Paul wrote: > >

Re: On rollover, gzip and keep unzipped file

2019-01-25 Thread Ralph Goers
Can you explain the use case for why you would want both? The primary reason for gzipping the files is to save space. Having both causes more space to be used. Ralph > On Jan 24, 2019, at 12:35 AM, Sameer Pradhan wrote: > > I am currently using > > > > >

Re: combine log4j2 SizeBasedTriggeringPolicy with CronTriggeringPolicy

2019-02-01 Thread Ralph Goers
Thanks for the report. I tested your sample project and the file pattern does not contain a “%I”. Without this files will get overwritten. But in the course of testing this after adding the %I I discovered that rolling was creating files with the wrong name. I have fixed that. Please try the

Re: OS

2019-04-18 Thread Ralph Goers
The answer to this question is the same as the one we gave you yesterday. Log4j 1.x reached end-of-life in August of 2015. So no, NTEventLogAppender is not supported. You can certainly install it and try it but any problems you may find will not be fixed here. Since it is open source you are

Re: How to use “callAppenders” under log4j2

2019-05-12 Thread Ralph Goers
Even after following the link I still have no idea what you are trying to accomplish. Can you explain it using words? As for the code below I don’t see how it will do anything useful. You have created a LoggerConfig that isn’t associated with a Configuration and has no elements attached to it

Re: How to use “callAppenders” under log4j2

2019-05-12 Thread Ralph Goers
PM, Ralph Goers wrote: > > Even after following the link I still have no idea what you are trying to > accomplish. Can you explain it using words? > > As for the code below I don’t see how it will do anything useful. You have > created a LoggerConfig that isn’t associated with a

Re: Colors and Files Appenders (?)

2019-06-10 Thread Ralph Goers
The Layout just formats the data as you direct it to. Pattern Converters don’t have the intelligence to know whether they are targeting a Console or a File. You need to provide the pattern that is appropriate for the instance of the Layout you want depending on what Appender it is in. Ralph

Re: Why is my Layout header not consistently writing?

2019-06-11 Thread Ralph Goers
My expectation is that a header is written when the file is first created and is empty and the footer is appended when the file is closed before a rollover. I suspect the first behavior is implemented but the footer is being written on every close. Unfortunately it has to do that to behave

<    2   3   4   5   6   7   8   9   10   >