logging-log4j-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Scott Deboy" <sde...@comotivsystems.com>
Subject RE: need help to use chainsaw VFSLogFilePatternReceiver
Date Wed, 09 Aug 2006 18:08:16 GMT
I'll make that change.

Thanks Jake


-----Original Message-----
From: Jacob Kjome [mailto:hoju@visi.com] 
Sent: Wednesday, August 09, 2006 10:49 AM
To: Log4J Users List
Subject: RE: need help to use chainsaw VFSLogFilePatternReceiver


I my experience, putty doesn't add anything to known_hosts.  I'm not
sure about
what cygwin does?  However, JSCH can do that by setting strict host
checking to
"no".  The following code will add the host + the host key to your
known_hosts
for you (assuming you've created it already.. it won't be created for
you).  I
hope this will be useful to users running into this problem in the
future.  Of
course, if Chainsaw did this, no one would have to deal with the
known_hosts
file at all, because with strict host key checking off known_hosts
doesn't even
have to exist and everything will still work (there might be security
risks
associated with doing this, but it would make Chainsaw user lives
easier).

You'll need the following jars (current versions) in the classpath to
run the
file below (only need commons-vfs to compile)....

commons-logging.jar
commons-net.jar
commons-vfs.jar
jakarta-oro.jar
jsch.jar


import org.apache.commons.vfs.*;
import org.apache.commons.vfs.provider.sftp.*;

public class GenerateKnownHostsInfo {
  public static void main(String[] args) throws Exception {
    FileSystemManager fsManager = VFS.getManager();
    FileSystemOptions opts = new FileSystemOptions();
 
SftpFileSystemConfigBuilder.getInstance().setStrictHostKeyChecking(opts,
"no");
    FileObject pkg =
fsManager.resolveFile("sftp://myusername:mypassword@myhost.com/path/to/f
ile/file.txt",
opts);
  }
}


Jake

Quoting Scott Deboy <sdeboy@comotivsystems.com>:

> Two things:
>
> 1. Make sure you have checked the 'ok to remove security manager' box
in
> the application-wide preferences menu.
>
> 2. You need the target server in your known_hosts file (by using putty
> or cygwin ssh to connect to the server).
>
> On windows, this known_hosts file needs to be in the /documents and
> settings/myaccount/.ssh directory - note the dot in .ssh
>
>
> Scott Deboy
>
> -----Original Message-----
> From: Bruno Cosnefroy [mailto:bruno.cosnefroy@gmail.com]
> Sent: Wednesday, August 09, 2006 2:19 AM
> To: log4j-user@logging.apache.org
> Subject: need help to use chainsaw VFSLogFilePatternReceiver
>
> Hi,
>
> I would like to read remote log files from a jboss server through
> chainsaw.
>
> I installed the dos standalone chainsaw-bundle on a windows xp
computer.
> I've made tests to read a local log file using a
LogFilePatternReceiver
> and
> it works.
> Now I try to read the file on a Linux server through SSH using a
> VFSLogFilePatternReceiver.
>
> As described on the chainsaw v2 documentation (
> http://logging.apache.org/log4j/docs/chainsaw.html), I've downloaded
the
> VFS
> extension, VFS, commons logging and the vfs dependencies required for
> ssh/sftp and placed them in the .chainsaw/plugins directory.
>
> I can start chainsaw and when I right-click on receivers... new
> receiver, i
> can create a new VFSLogFilePatternReceiver.
>
> When I create a new receiver or when I add it in my chainsaw
> configuration
> file and restart chainsaw, my receiver seems to be started but the
> corresponding tab does not appear. I get the following info message in
> chainsaw-log:
> "attempting to load file: sftp://myusername:mypassword@myhost
> :22/path/server.log"
> and then "file not available - will try again in 10 seconds".
>
> I've checked my username, password and path and they are correct.
>
> I have the following jars in the plugins directory:
> commons-logging-1.1.jar
> commons-logging-adapters-1.1.jar
> commons-logging-api-1.1.jar
> commons-net-1.4.1.jar
> commons-vfs-20060731.jar
> jakarta-oro-2.0.8.jar
> jsch-0.1.28.jar
> log4j-chainsaw-vfs.jar
>
>
> My configuration file contains the following lines:
>
> <plugin name="VFSLogFilePatternReceiver"
>   class="org.apache.log4j.chainsaw.vfs.VFSLogFilePatternReceiver">
>   <param name="fileURL"
>    value="sftp://myuser:mypwd@myhost:22/var/log/jboss/server.log" />
>   <param name="timestampFormat" value="yyyy-MM-d HH:mm:ss,SSS" />
>   <param name="logFormat"
>    value="TIMESTAMP LEVEL [CLASS] MESSAGE" />
>   <param name="name" value="jboss-remote-log-file" />
>   <param name="tailing" value="false" />
> </plugin>
>
> Is there anything I've missed?
>
> Thanks,
> Bruno
>
> ---------------------------------------------------------------------
> 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


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


Mime
View raw message