You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4j-user@logging.apache.org by Jacob Kjome <ho...@visi.com> on 2005/12/09 07:37:04 UTC

VFSLogFilePatternReceiver usage?

I feel like I should know this, but having never actually trying the 
VFSLogFilePatternReceiver before and trying to set it up now, I realize 
that I don't.  Here's what I've done....

1.  Installed latest Webstart version of Chainsaw
2.  Created $user.home/.chainsaw/plugins directory
3.  Added commons-vfs-1.0-RC7.jar and *all* mandatory + optional 
dependencies to the plugins directory.  See...
http://people.apache.org/~imario/vfs/
http://people.apache.org/~imario/vfs-1.0-RC7/site/download.html

4.  Launched chainsaw and looked at the log.  Chainsaw reports nothing 
about loading the VFSLogFilePatternReceiver, but does report finding other 
receivers, including...
"Located known Receiver class org.apache.log4j.varia.LogFilePatternReceiver"

VFSLogFilePatternReceiver comes with Chainsaw, no?  It seems to be in the 
chainsaw jar in the downloadable chainsaw package.  Why doesn't it exist 
for WebStart with all the necessary VFS dependencies available in the 
plugins directory?

BTW, where do we load a plugin config file?  Can it only be loaded upon 
startup, defined in the global options?  The "load file" options under the 
"file" menu only seem to apply to log files in XML format, not plugin 
config files.  If it is possible to dynamically create receivers using the 
Chainsaw Receiver panel, why can't I dynamically create them by loading a 
plugin config file at runtime?  I must be missing something.

Also, is there anything that can be done about "logFormat" recognition for 
the FilePatternReceiver in the case where the log file contains 
heterogeneous patterns?  For instance, under Tomcat, I've got Log4j in 
common/lib and have defined a Console appender for the default logger 
repository.  I'm using the NT Service for Tomcat (on WinXP) which captures 
System.out and logs it to file, for which the service (or Tomcat) controls 
the rolling.  Then, in my webapps, I use a console appender for certain 
logging which also ends up in that file.  The patterns that the server use 
can be different than that of the webapps resulting in more than one 
pattern in the log file.  Not only that, but there might be certain cases 
where code literally uses System.out (bad code!) and there is no real 
pattern.  Might Chainsaw be enhanced to deal with this by using multiple 
patterns?  I'm not sure it's possible, but it would be nice if it were.

Anyway, I've rambled enough.

thanks,

Jake


---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-user-help@logging.apache.org


Re: VFSLogFilePatternReceiver usage?

Posted by Jacob Kjome <ho...@visi.com>.
Quoting Paul Smith <ps...@aconex.com>:

> First question, did you tick the "Ok to remove SecurityManager" in
> the application preferences?  If this is not ticked, particularly
> with the Webstart version it's impossible load stuff from the plugins
> directory.  By ticking this box, you turn off the SecurityManager,
> and allow a TCL to be created, which knows how to load classes from
> the .plugins area.
>

Yep, I did that, then put my config URL in the global settings, restarted,  and
now it fails on startup with this error...

java.lang.reflect.InvocationTargetException
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.lang.reflect.Method.invoke(Unknown Source)
	at com.sun.javaws.Launcher.executeApplication(Unknown Source)
	at com.sun.javaws.Launcher.executeMainClass(Unknown Source)
	at com.sun.javaws.Launcher.continueLaunch(Unknown Source)
	at com.sun.javaws.Launcher.handleApplicationDesc(Unknown Source)
	at com.sun.javaws.Launcher.handleLaunchFile(Unknown Source)
	at com.sun.javaws.Launcher.run(Unknown Source)
	at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.NoClassDefFoundError:
org/apache/commons/vfs/FileSystemException
	at
org.apache.log4j.chainsaw.vfs.VFSLogFilePatternReceiver.activateOptions(VFSLogFilePatternReceiver.java:136)
	at org.apache.log4j.joran.action.PluginAction.end(PluginAction.java:88)
	at org.apache.log4j.joran.spi.Interpreter.callEndAction(Interpreter.java:274)
	at org.apache.log4j.joran.spi.Interpreter.endElement(Interpreter.java:155)
	at
org.apache.log4j.joran.spi.JoranDocument$EndElementEvent.replay(JoranDocument.java:206)
	at org.apache.log4j.joran.spi.JoranDocument.replay(JoranDocument.java:113)
	at
org.apache.log4j.joran.JoranConfigurator.doConfigure(JoranConfigurator.java:170)
	at
org.apache.log4j.joran.JoranConfigurator.doConfigure(JoranConfigurator.java:89)
	at
org.apache.log4j.chainsaw.LogUI.loadConfigurationUsingPluginClassLoader(LogUI.java:1846)
	at org.apache.log4j.chainsaw.LogUI.createChainsawGUI(LogUI.java:314)
	at org.apache.log4j.chainsaw.LogUI.main(LogUI.java:250)
	... 11 more


> Having said that, it's possible that the last Webstart build somehow
> broke VFS compatibility.  Scott?  If this is the case, I could fast
> track a new build.  Does the same thing happen if you check out log4j-
> chainsaw SVN project and run it via 'ant chainsaw' ?
>

I don't have access to do that at work.  I could see if I can download a tarball
of the latest source and try it.  I'll see what I can do.

Jake

> cheers,
>
> Paul
>
> On 09/12/2005, at 5:37 PM, Jacob Kjome wrote:
>
> >
> > I feel like I should know this, but having never actually trying
> > the VFSLogFilePatternReceiver before and trying to set it up now, I
> > realize that I don't.  Here's what I've done....
> >
> > 1.  Installed latest Webstart version of Chainsaw
> > 2.  Created $user.home/.chainsaw/plugins directory
> > 3.  Added commons-vfs-1.0-RC7.jar and *all* mandatory + optional
> > dependencies to the plugins directory.  See...
> > http://people.apache.org/~imario/vfs/
> > http://people.apache.org/~imario/vfs-1.0-RC7/site/download.html
> >
> > 4.  Launched chainsaw and looked at the log.  Chainsaw reports
> > nothing about loading the VFSLogFilePatternReceiver, but does
> > report finding other receivers, including...
> > "Located known Receiver class
> > org.apache.log4j.varia.LogFilePatternReceiver"
> >
> > VFSLogFilePatternReceiver comes with Chainsaw, no?  It seems to be
> > in the chainsaw jar in the downloadable chainsaw package.  Why
> > doesn't it exist for WebStart with all the necessary VFS
> > dependencies available in the plugins directory?
> >
> > BTW, where do we load a plugin config file?  Can it only be loaded
> > upon startup, defined in the global options?  The "load file"
> > options under the "file" menu only seem to apply to log files in
> > XML format, not plugin config files.  If it is possible to
> > dynamically create receivers using the Chainsaw Receiver panel, why
> > can't I dynamically create them by loading a plugin config file at
> > runtime?  I must be missing something.
> >
> > Also, is there anything that can be done about "logFormat"
> > recognition for the FilePatternReceiver in the case where the log
> > file contains heterogeneous patterns?  For instance, under Tomcat,
> > I've got Log4j in common/lib and have defined a Console appender
> > for the default logger repository.  I'm using the NT Service for
> > Tomcat (on WinXP) which captures System.out and logs it to file,
> > for which the service (or Tomcat) controls the rolling.  Then, in
> > my webapps, I use a console appender for certain logging which also
> > ends up in that file.  The patterns that the server use can be
> > different than that of the webapps resulting in more than one
> > pattern in the log file.  Not only that, but there might be certain
> > cases where code literally uses System.out (bad code!) and there is
> > no real pattern.  Might Chainsaw be enhanced to deal with this by
> > using multiple patterns?  I'm not sure it's possible, but it would
> > be nice if it were.
> >
> > Anyway, I've rambled enough.
> >
> > thanks,
> >
> > Jake
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
> > For additional commands, e-mail: log4j-user-help@logging.apache.org
> >
> >
>
>




---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-user-help@logging.apache.org


Re: VFSLogFilePatternReceiver usage?

Posted by Paul Smith <ps...@aconex.com>.
First question, did you tick the "Ok to remove SecurityManager" in  
the application preferences?  If this is not ticked, particularly  
with the Webstart version it's impossible load stuff from the plugins  
directory.  By ticking this box, you turn off the SecurityManager,  
and allow a TCL to be created, which knows how to load classes from  
the .plugins area.

Having said that, it's possible that the last Webstart build somehow  
broke VFS compatibility.  Scott?  If this is the case, I could fast  
track a new build.  Does the same thing happen if you check out log4j- 
chainsaw SVN project and run it via 'ant chainsaw' ?

cheers,

Paul

On 09/12/2005, at 5:37 PM, Jacob Kjome wrote:

>
> I feel like I should know this, but having never actually trying  
> the VFSLogFilePatternReceiver before and trying to set it up now, I  
> realize that I don't.  Here's what I've done....
>
> 1.  Installed latest Webstart version of Chainsaw
> 2.  Created $user.home/.chainsaw/plugins directory
> 3.  Added commons-vfs-1.0-RC7.jar and *all* mandatory + optional  
> dependencies to the plugins directory.  See...
> http://people.apache.org/~imario/vfs/
> http://people.apache.org/~imario/vfs-1.0-RC7/site/download.html
>
> 4.  Launched chainsaw and looked at the log.  Chainsaw reports  
> nothing about loading the VFSLogFilePatternReceiver, but does  
> report finding other receivers, including...
> "Located known Receiver class  
> org.apache.log4j.varia.LogFilePatternReceiver"
>
> VFSLogFilePatternReceiver comes with Chainsaw, no?  It seems to be  
> in the chainsaw jar in the downloadable chainsaw package.  Why  
> doesn't it exist for WebStart with all the necessary VFS  
> dependencies available in the plugins directory?
>
> BTW, where do we load a plugin config file?  Can it only be loaded  
> upon startup, defined in the global options?  The "load file"  
> options under the "file" menu only seem to apply to log files in  
> XML format, not plugin config files.  If it is possible to  
> dynamically create receivers using the Chainsaw Receiver panel, why  
> can't I dynamically create them by loading a plugin config file at  
> runtime?  I must be missing something.
>
> Also, is there anything that can be done about "logFormat"  
> recognition for the FilePatternReceiver in the case where the log  
> file contains heterogeneous patterns?  For instance, under Tomcat,  
> I've got Log4j in common/lib and have defined a Console appender  
> for the default logger repository.  I'm using the NT Service for  
> Tomcat (on WinXP) which captures System.out and logs it to file,  
> for which the service (or Tomcat) controls the rolling.  Then, in  
> my webapps, I use a console appender for certain logging which also  
> ends up in that file.  The patterns that the server use can be  
> different than that of the webapps resulting in more than one  
> pattern in the log file.  Not only that, but there might be certain  
> cases where code literally uses System.out (bad code!) and there is  
> no real pattern.  Might Chainsaw be enhanced to deal with this by  
> using multiple patterns?  I'm not sure it's possible, but it would  
> be nice if it were.
>
> Anyway, I've rambled enough.
>
> thanks,
>
> Jake
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
> For additional commands, e-mail: log4j-user-help@logging.apache.org
>
>