Custom ConfigurationFactory not loaded

2014-07-31 Thread Clément Guillaume
Hi, I'm trying to use a custom ConfigurationFactory. I created and annotated it with a @Plugin and an @Order like this: @Plugin(category = "ConfigurationFactory", name = "StartupConfigurationFactory") @Order(10) public class StartupConfigurationFactory extends ConfigurationFactory{ ... } But it

Re: Custom ConfigurationFactory not loaded

2014-07-31 Thread Clément Guillaume
fig file. So a > configuration factory cannot be a plugin. > > Best regards, > Remko > > Sent from my iPhone > > > On 2014/08/01, at 10:18, Clément Guillaume > wrote: > > > > Hi, > > > > I'm trying to use a custom ConfigurationFactory.

Re: Custom ConfigurationFactory not loaded

2014-07-31 Thread Clément Guillaume
efault ConfigurationFactory. > > > On 31 July 2014 21:34, Clément Guillaume wrote: > > > Oh ! I did this because of the documentation available here: > > > > > http://logging.apache.org/log4j/2.x/manual/extending.html#ConfigurationFactory > > > > The second method

Re: Custom ConfigurationFactory not loaded

2014-08-01 Thread Clément Guillaume
ctory would have to handle XML, JSON and > YAML configurations. > > > > I would suggest having getSupportedTypes return something like “.cfg” > and then having your configuration files end with .cfg. > > > > Ralph > > > > On Jul 31, 2014, at 6:18 PM, Clément Guillaum

Re: Custom ConfigurationFactory not loaded

2014-08-01 Thread Clément Guillaume
ges attribute in configuration (and the corresponding > PluginManager.addPackage method) does not work in 2.0. > > This has been fixed in trunk and the fix will be in the upcoming 2.0.1 > release. > Can you try with trunk? > > > On Sat, Aug 2, 2014 at 2:05 AM, Clément Guillaume >

Re: Custom ConfigurationFactory not loaded

2014-08-04 Thread Clément Guillaume
ee if your > application is having a Log4j2Plugins.dat file being generated and included > in your jar. > > Sent from my iPad > > > On Aug 1, 2014, at 1:06 PM, Clément Guillaume > wrote: > > > > PluginManager.addPackage(“com.myorg.mypackage”) works with trunk

Re: plugin-registration failing

2014-08-22 Thread Clément Guillaume
Hi, I'm also using some custom plugins and several project and wars. I just succeeded to setup a maven build that generate the Log4j2Plugins.dat. First I enable the annotation processor on the project that content my plugins: org.bsc.maven maven-processor-plugin 2.2.1 process process proces

Appenders

2014-08-25 Thread Clément Guillaume
Hi, I would love to have a direct access to the target of a ConsoleAppender (as I can directly get the fileName of a FileAppender). Do you plan to implement this feature ? (and also for others properties like ConsoleAppender.isFollow or FileAppender.immediateFlush, ...) I also would love to be a

Re: Appenders

2014-08-26 Thread Clément Guillaume
d instead. > > > On 25 August 2014 14:22, Clément Guillaume wrote: > > > Hi, > > > > I would love to have a direct access to the target of a ConsoleAppender > (as > > I can directly get the fileName of a FileAppender). Do you plan to >

Re: Appenders

2014-08-28 Thread Clément Guillaume
rs need fields to remain > immutable for performance or safety reasons, so creating a new Appender on > reconfigure is generally the safer option. > > > On 26 August 2014 02:43, Clément Guillaume wrote: > > > Yes, I know that. > > So if I have 10 LoggerConfigs that u

Print the LoggerContext name

2015-07-13 Thread Clément Guillaume
Is it possible to print the LoggerContext name in the output? Clément

Re: Print the LoggerContext name

2015-07-18 Thread Clément Guillaume
og4j/2.x/manual/extending.html#Lookups) and > include it in your PatternLayout's pattern. > > Sent from my iPhone > > > On 2015/07/18, at 9:39, Gary Gregory wrote: > > > > Hm... I do not think so. Patches welcome of course. What are your > > expectations for suc

Re: Print the LoggerContext name

2015-07-18 Thread Clément Guillaume
Yes, I trying to print the servletContext.servletContextName using the WebLookup (${web:servletContextName}). But it doesn't work for now. On Sat, Jul 18, 2015 at 8:26 PM, Gary Gregory wrote: > So you are using servletContextName? > > Gary > > On Sat, Jul 18, 2015 at 8:19 P

Re: Print the LoggerContext name

2015-07-21 Thread Clément Guillaume
log4j/2.x/manual/webapp.html ? > > Gary > > On Sat, Jul 18, 2015 at 8:30 PM, Clément Guillaume > > wrote: > > > Yes, I trying to print the servletContext.servletContextName using the > > WebLookup (${web:servletContextName}). But it doesn't work for now. > >

File handle on Windows

2017-01-31 Thread Clément Guillaume
Hi, I have a unit test, using log4j 2.8 to log to a file using a FileAppender, that deletes the log file at the end of the test. This test works well on linux, but fails on Windows because the java process still has a file handle to the log file, and so the file cannot be deleted. Any idea how to

Re: File handle on Windows

2017-01-31 Thread Clément Guillaume
It doesn't help, when DeleteOnExitHook is called the file handle is still there On Tue, Jan 31, 2017 at 10:26 AM, Remko Popma wrote: > You can try calling File.deleteOnExit(). > > On Wed, Feb 1, 2017 at 3:17 AM, Clément Guillaume > wrote: > > > Hi, > > > &g

Re: File handle on Windows

2017-01-31 Thread Clément Guillaume
hristopher Schultz < ch...@christopherschultz.net> wrote: > Clément, > > On 1/31/17 1:17 PM, Clément Guillaume wrote: > > I have a unit test, using log4j 2.8 to log to a file using a > FileAppender, > > that deletes the log file at the end of the test. This test works

Re: File handle on Windows

2017-01-31 Thread Clément Guillaume
Found it. I'm able to delete the file after calling LoggerContext.stop(). Is there a recommended practice between calling Configurator.shutdown(LoggerContext) or LoggerContext.stop()? On Tue, Jan 31, 2017 at 1:51 PM, Clément Guillaume wrote: > I looked at the unit tests. I'm usi

Programmatically configure jul to route to log4j2

2017-05-01 Thread Clément Guillaume
Hi, I wonder if it would be possible to programmatically configure jul to route to log4j2. It would be useful in case where system properties can not be used to set the LogManager or the log4j-jul jar cannot be in the classpath at bootstrap. jul to log4j2 bridge allow a similar configuration: htt

Re: Print the LoggerContext name

2017-05-11 Thread Clément Guillaume
This was not working because my web.xml was setting absolute-ordering and so the Log4jServletContainerInitializer was never called. On Tue, Jul 21, 2015 at 11:07 AM, Clément Guillaume wrote: > Yes, I have the log4j-web jar in my classpath, I'm in a servlet 3.0 > environment so I don

logging Exception toString with slf4j

2020-10-07 Thread Clément Guillaume
Hi, I'm using slf4j (1.7.25) and log4j (2.13.3). My config is simple, just a console appender. I'm trying to log the toString of an Exception with a parameterized message. It works fine when there is more than one parameter, but when it's a single one, the whole exception stacktrace is printed. o

Re: logging Exception toString with slf4j

2020-10-08 Thread Clément Guillaume
think logger.warn("{} ", new Exception("my message")); will call > warn(java.lang.String,java.lang.Throwable) > < > http://www.slf4j.org/apidocs/org/slf4j/Logger.html#warn(java.lang.String,java.lang.Throwable > > > ). > > > On Thu, Oct 8, 2020 at 7:4

log pattern - servlet context name with fallback on pid

2021-03-24 Thread Clément Guillaume
Hello, I'm trying to make a log pattern showing the servlet context name or, if missing, showing the process id. ${web:servletContextName} %msg works well for servlet context name alone. %pid %msg works well for process id alone. ${web:servletContextName:-${sys:user.name}} %msg works well for s

Re: log pattern - servlet context name with fallback on pid

2021-03-26 Thread Clément Guillaume
b:servletContextName}}{}{%pid}*. Would you mind checking, > please? > > Kind regards. > > On Thu, Mar 25, 2021 at 2:32 AM Clément Guillaume > wrote: > > > Hello, > > > > I'm trying to make a log pattern showing the servlet context name or, if > > missi