Project Home
Project Home
Documents
Documents
Wiki
Wiki
Discussion Forums
Discussions
Project Information
Project Info
Forum Topic - Logging to remote Node via slog?: (10 Items)
   
Logging to remote Node via slog?  
Hi,

I'd like to log to a remote qnx node (i.e., connected by tcp/ip / qnet).
What is the easiest/best way to achieve this? The log commands a la slogf()
do not take an alternative destination device (/dev/slog) as a parameter,
so specifying /net/node/dev/slog will probably not work.
Another option would be creating a symlink named /dev/slog that
points to /net/node/dev/slog, but this doesnt work either.
I also did not find any remote logging ("forward") option for slogger.

What's the general consensus on the "best way" to do this?

Regards, Marc.
RE: Logging to remote Node via slog?  

> -----Original Message-----
> From: Marc Roessler [mailto:marc.roessler@solectrix.de]
> Sent: June 27, 2008 10:27 AM
> To: ostech-core_os
> Subject: Logging to remote Node via slog?
> 
> Hi,
> 
> I'd like to log to a remote qnx node (i.e., connected by tcp/ip /
qnet).
> What is the easiest/best way to achieve this? The log commands a la
slogf()
> do not take an alternative destination device (/dev/slog) as a
parameter,
> so specifying /net/node/dev/slog will probably not work.
> Another option would be creating a symlink named /dev/slog that
> points to /net/node/dev/slog, but this doesnt work either.

Not sure why this one is not working...

 # ln -sfP /net/node/dev/slog /dev/slog

This worked for me in the pass.

> I also did not find any remote logging ("forward") option for slogger.
> 
> What's the general consensus on the "best way" to do this?
> 
> Regards, Marc.
> 
> _______________________________________________
> OSTech
> http://community.qnx.com/sf/go/post9780
Re: RE: Logging to remote Node via slog?  
OK, worked when using the -P parameter.
I suppose you stop the local slogger in that case, correct?
Re: RE: Logging to remote Node via slog?  
oh by the way... any way I can
- automatically reverse lookup the major/minor codes so they are more human readable?
- mark where the individual log entries are coming from? e.g. when the system reports a file system error, how do I know
 from the logs which system it was?
Re: RE: Logging to remote Node via slog?  
> I suppose you stop the local slogger in that case, correct?

As long as slogger is started BEFORE the "ln -sfP", the new name would cover up older one. But stop the local slogger is
 always a good idea. 

> oh by the way... any way I can
> - automatically reverse lookup the major/minor codes so they are more human readable?

Other then "sloginfo -m <major_code>", I don't know anything more "close". 

> - mark where the individual log entries are coming from? e.g. when the system 
> reports a file system error, how do I know from the logs which system it was?

I guess you can put node id/name in slogf()?


Re: RE: Logging to remote Node via slog?  
> I guess you can put node id/name in slogf()?
Of course.. but I would need to patch all calls to slogf() and similar functions in _all_ of the applications and in all
 of the OS - remember, the OS also logs,
and I also want that information to be available. Quite infeasible I guess...
I could use something like a wrapper function to slog*(), but this is also a bad hack.

RE: RE: Logging to remote Node via slog?  
I see.

Then maybe took the slogger source, when ever it got an message, also
find out where is the message come from, and log that information.

> -----Original Message-----
> From: Marc Roessler [mailto:marc.roessler@solectrix.de]
> Sent: June 30, 2008 11:04 AM
> To: ostech-core_os
> Subject: Re: RE: Logging to remote Node via slog?
> 
> > I guess you can put node id/name in slogf()?
> Of course.. but I would need to patch all calls to slogf() and similar
functions
> in _all_ of the applications and in all of the OS - remember, the OS
also logs,
> and I also want that information to be available. Quite infeasible I
guess...
> I could use something like a wrapper function to slog*(), but this is
also a
> bad hack.
> 
> 
> 
> _______________________________________________
> OSTech
> http://community.qnx.com/sf/go/post9863
Re: RE: RE: Logging to remote Node via slog?  
> Then maybe took the slogger source, when ever it got an message, also
> find out where is the message come from, and log that information.
well that won't be possible either, because the logging "slogger" reads from
/dev/slog. Since both the local and the remote process access this file
transparently, slogger can not differentiate which process wrote which input?
RE: RE: RE: Logging to remote Node via slog?  
The idea of QNET is to extend the client-server message passing cross
network, *transparently*. However, the server CAN know where is the
message comes from if it choose to.

"slogger" does not "read from /dev/slog", it post (create) that pathname
for others to access it. This is general "resource manager" idea.

In detail, the "ctp" passed in io_write(), have a
"ctp->info.nd/ctp->info.pid" to tell where is the message comes from.

> -----Original Message-----
> From: Marc Roessler [mailto:marc.roessler@solectrix.de]
> Sent: June 30, 2008 12:10 PM
> To: ostech-core_os
> Subject: Re: RE: RE: Logging to remote Node via slog?
> 
> > Then maybe took the slogger source, when ever it got an message,
also
> > find out where is the message come from, and log that information.
> well that won't be possible either, because the logging "slogger"
reads from
> /dev/slog. Since both the local and the remote process access this
file
> transparently, slogger can not differentiate which process wrote which
input?
> 
> _______________________________________________
> OSTech
> http://community.qnx.com/sf/go/post9867
Re: RE: RE: RE: Logging to remote Node via slog?  
> In detail, the "ctp" passed in io_write(), have a
> "ctp->info.nd/ctp->info.pid" to tell where is the message comes from.
Ok so this would be possible then. Will have a look, thanks!