RE: viewing remote logfile over SSH using Chainsaw

2005-07-18 Thread Rami Abramson
We have all the required dependencies and the "known_hosts" seems not to
be the problem.

Nevertheless, here's the Chainsaw execution which has an error in the
end (after the printout the lines that contain the username/password etc
where changed for security reasons):

===
D:\dev\tools\logging\chainsaw>chainsaw.bat

D:\dev\tools\logging\chainsaw>java -classpath
ext-lib/commons-collections-3.1.jar;ext-lib/commons-collections-testfram
ework-3.1.jar;ext-lib/commons-compress-20040530.jar;ext-lib/commons-http
client-3.0
-rc3.jar;ext-lib/commons-logging.jar;ext-lib/commons-logging-api.jar;ext
-lib/commons-net-1.4.0.jar;ext-lib/commons-vfs-1.0-RC2.jar;ext-lib/jakar
ta-oro-2.0.8.jar;ext-lib/jcifs-1.2.1.jar;ext-lib/jsch-0.
1.21.jar;log4j-1.3alpha-7.jar;log4j-chainsaw-1.3alpha-7.jar;ugli-simple.
jar;log4j-xml.jar;log4j-optional.jar;log4j-oro.jar
org.apache.log4j.chainsaw.LogUI
Using font=Arial
*** configurationOptionStr=null
** End of LogManager static initializer
log4j:INFO Creating new logger [org.apache.log4j.chainsaw.LogUI] in
repository [default].
log4j:INFO Creating new logger
[org.apache.log4j.chainsaw.plugins.PluginClassLoaderFactory] in
repository [default].
log4j:INFO Returning existing logger [org.apache.log4j] in repository
[default].
log4j:INFO Creating new logger
[org.apache.log4j.joran.action.ConfigurationAction] in repository
[default].
0 [main] ERROR org.apache.log4j.varia.ListAppender - Attempted to log
with inactive appender named [TEMP_LIST_APPENDER].
LOG4J-INTERNAL: 2005-07-19 06:19:06,052 DEBUG [main]
org.apache.log4j.joran.action.ConfigurationAction#begin:42)- Starting
internal logs on console.
log4j:INFO Creating new logger
[org.apache.log4j.joran.action.AppenderAction] in repository [default].
16 [main] ERROR org.apache.log4j.varia.ListAppender - Attempted to log
with inactive appender named [TEMP_LIST_APPENDER].
LOG4J-INTERNAL: 2005-07-19 06:19:06,083 DEBUG [main]
org.apache.log4j.joran.action.AppenderAction#begin:52)- About to
instantiate appender of type [org.apache.log4j.ConsoleAppender]
16 [main] ERROR org.apache.log4j.varia.ListAppender - Attempted to log
with inactive appender named [TEMP_LIST_APPENDER].
LOG4J-INTERNAL: 2005-07-19 06:19:06,083 DEBUG [main]
org.apache.log4j.joran.action.AppenderAction#begin:67)- Appender named
as [A2]
LOG4J-INTERNAL: 2005-07-19 06:19:06,083 DEBUG [main]
org.apache.log4j.joran.action.AppenderAction#begin:78)- Pushing appender
on to the object stack.
log4j:INFO Creating new logger
[org.apache.log4j.joran.action.LayoutAction] in repository [default].
LOG4J-INTERNAL: 2005-07-19 06:19:06,099 DEBUG [main]
org.apache.log4j.joran.action.LayoutAction#begin:45)- About to
instantiate layout of type [org.apache.log4j.SimpleLayout]
LOG4J-INTERNAL: 2005-07-19 06:19:06,099 DEBUG [main]
org.apache.log4j.joran.action.LayoutAction#begin:56)- Pushing layout on
top of the object stack.
LOG4J-INTERNAL: 2005-07-19 06:19:06,114 DEBUG [main]
org.apache.log4j.joran.action.LayoutAction#end:86)- Popping layout from
the object stack
LOG4J-INTERNAL: 2005-07-19 06:19:06,114 DEBUG [main]
org.apache.log4j.joran.action.LayoutAction#end:90)- About to set the
layout of the containing appender.
LOG4J-INTERNAL: 2005-07-19 06:19:06,114 DEBUG [main]
org.apache.log4j.joran.action.AppenderAction#end:110)- Popping appender
named [A2] from the object stack
log4j:INFO Creating new logger
[org.apache.log4j.joran.action.PluginAction] in repository [default].
LOG4J-INTERNAL: 2005-07-19 06:19:06,114 DEBUG [main]
org.apache.log4j.joran.action.PluginAction#begin:44)- About to
instantiate plugin of type
[org.apache.log4j.chainsaw.vfs.VFSLogFilePatternReceiver]

LOG4J-INTERNAL: 2005-07-19 06:19:06,145 DEBUG [main]
org.apache.log4j.joran.action.PluginAction#begin:58)- plugin named as
[ssh-example]
LOG4J-INTERNAL: 2005-07-19 06:19:06,161 DEBUG [main]
org.apache.log4j.joran.action.PluginAction#begin:66)- Pushing plugin on
to the object stack.
log4j:INFO Creating new logger
[org.apache.log4j.joran.action.ParamAction] in repository [default].
LOG4J-INTERNAL: 2005-07-19 06:19:06,161 DEBUG [main]
org.apache.log4j.joran.action.ParamAction#begin:61)- In ParamAction
setting parameter [fileURL] to value
[sftp://myusername:[EMAIL PROTECTED]:22/path/to/server.log]. --> WAS
CHANGED FOR SECURITY REASONS AFTER THE PRINTOUT...
LOG4J-INTERNAL: 2005-07-19 06:19:06,177 DEBUG [main]
org.apache.log4j.joran.action.ParamAction#begin:61)- In ParamAction
setting parameter [timestampFormat] to value [dd-MM- HH:mm:ss,SSS].
LOG4J-INTERNAL: 2005-07-19 06:19:06,192 DEBUG [main]
org.apache.log4j.joran.action.ParamAction#begin:61)- In ParamAction
setting parameter [logFormat] to value [TIMESTAMP LOGGER LEVEL [THREAD]
- MESSA
GE].
LOG4J-INTERNAL: 2005-07-19 06:19:06,192 DEBUG [main]
org.apache.log4j.joran.action.ParamAction#begin:61)- In ParamAction
setting parameter [tailing] to value [true].
LOG4J-INTERNAL: 2005-07-19 06:19:06,208 DEBUG [main]
org.apache.log4j.joran.action.PluginAction#end:98)- Popping plugin named
[ssh-e

RE: Apache Commons Collection - CompositeConfiguration

2005-07-18 Thread Mark Womack
Well, if CompositeConfiguration supports getting a Properties object to
represent the configuration settings, then you could plug it into the
PropertyConfigurator through doConfigure(Properties, LoggerRepository)
pretty easily.  Though there is no way to do automatic, default
configuration (ie a single property or xml file).  You'll have to write your
on code to create the CompositeConfiguration and then pass it into
PropertyConfigurator.


I think it is a weakness of the Configurator interface that it requires you
to support/specify a file, etc.  And then each configurator has to define
source specific methods.  It would be nice if it could use a "wrapper"
interface where implementations could wrap a file, or a stream, or a
CompositeConfiguration, etc.  Haven't thought about it very hard, so not
sure what it would look like, but something that says "give me all the
appender settings configured in this configuration", "give me all the logger
settings configured in this configuration", etc.  Leave it up to the
implementation to figure out the details.  Then the common code would be
responsible for actually configuring the environment using the data.  Hm.


-Mark

> -Original Message-
> From: Moran Ben-David [mailto:[EMAIL PROTECTED]
> Sent: Monday, July 18, 2005 3:48 PM
> To: log4j-user@logging.apache.org
> Subject: Apache Commons Collection - CompositeConfiguration
> 
> Hi.
> 
> 
> 
> I am looking to configure Log4J in my app to use a composite configuration
> (one based on multiple files).  Has anyone done this before?  (I searched
> the list and didn't find any mention of it.)   Am I correct in wanting to
> extend through org.apache.log4j.config to do this?
> 
> 
> 
> Does anyone have information on how to use the
> 
> 
> 
> org.apache.log4j.config
>  unstable/org/apache/log4j/config/p
> ackage-frame.html>
> 
> 
> 
> package and extend with it?  I'm going through the javadoc but was hoping
> that someone else was kind enough to document this process.
> 
> 
> 
> Here's more info on what I'm trying to do in case anyone is kind enough to
> lend some eyes and braincells:
> 
> 
> 
> I want the configuration that log4j will use to be derived from a series
> of
> files and not just from a single file.  Propreties existing in two files,
> will be overriden by the higher priority file (i.e. the earlier one in the
> list or vice versa).
> 
> 
> 
> I'm thinking that the best way to do this is to use the Apache Common
> Configuration framework's CompositeConfiguration:
> 
> 
> 
> CompositeConfiguration config = new CompositeConfiguration();
> config.addConfiguration(new SystemConfiguration());
> config.addConfiguration(new
> PropertiesConfiguration("application.properties"));
> 
> 
> 
> And then to get Log4J to pickup it's configuration from that "config"
> object.  Now comes the task of plugging into log4j.
> 
> 
> 
> Any answers to the questions above would be greatly appreciated.
> 
> 
> 
> Thanks
> 
> Moran Ben-David
> 
> http://www.place-base.com
> 
> 



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Apache Commons Collection - CompositeConfiguration

2005-07-18 Thread Moran Ben-David
Hi.

 

I am looking to configure Log4J in my app to use a composite configuration
(one based on multiple files).  Has anyone done this before?  (I searched
the list and didn't find any mention of it.)   Am I correct in wanting to
extend through org.apache.log4j.config to do this?

 

Does anyone have information on how to use the

 

org.apache.log4j.config
 

 

package and extend with it?  I'm going through the javadoc but was hoping
that someone else was kind enough to document this process.

 

Here's more info on what I'm trying to do in case anyone is kind enough to
lend some eyes and braincells:

 

I want the configuration that log4j will use to be derived from a series of
files and not just from a single file.  Propreties existing in two files,
will be overriden by the higher priority file (i.e. the earlier one in the
list or vice versa).

 

I'm thinking that the best way to do this is to use the Apache Common
Configuration framework's CompositeConfiguration:

 

CompositeConfiguration config = new CompositeConfiguration();
config.addConfiguration(new SystemConfiguration());
config.addConfiguration(new
PropertiesConfiguration("application.properties"));

 

And then to get Log4J to pickup it's configuration from that "config"
object.  Now comes the task of plugging into log4j.

 

Any answers to the questions above would be greatly appreciated.

 

Thanks

Moran Ben-David

http://www.place-base.com

 



Re: Log4J: System.out and System.err

2005-07-18 Thread James Stauffer
I think cvs has an example class for capturing system out and err.  I
know I have seen an example somewhere.
I think -Dlog4j.debug=true always generates output to system out. 
Besides that I am not sure what else would go to system out (unless
using a ConsoleAppender).

On 7/14/05, Mike Wannamaker <[EMAIL PROTECTED]> wrote:
> Is there a way to tell log4J to capture System.out or System.err?  Also it
> looks like log4j at certain levels of logging also logs to the
> System.err/System.out can anyone confirm this?  Possibly through something
> called a QuietWriter?
> 
> TIA
> --ekiM
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 


-- 
James Stauffer
Are you good? Take the test at http://www.livingwaters.com/good/

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]