Hello,
I try to use the "logger" command, because I would like to add some log in a
file, but it doesn't work. I had a look in the man, and tried :
%> logger -t myTag -f /var/adm/myfile message
Normaly. it must return a value: 0 if everything's ok or >0 if there was a
problem, but for me, it returns nothing at all. And it didn't add the log in
the file sure.
What's the problem ?
Thank you.
--
Bc.
|
|
0
|
|
|
|
Reply
|
Bc
|
7/28/2004 8:49:12 AM |
|
In article <ce7p58$2k1$1@zcars0v6.ca.nortel.com>, Bc. wrote:
>I try to use the "logger" command, because I would like to add some log in a
>file, but it doesn't work. I had a look in the man, and tried :
>
>%> logger -t myTag -f /var/adm/myfile message
>
>Normaly. it must return a value: 0 if everything's ok or >0 if there was a
>problem, but for me, it returns nothing at all. And it didn't add the log in
>the file sure.
>What's the problem ?
Right after you've run this try "echo $status" (I'm guessing csh
from your prompt). That should show the return value and it should
be a number - either zero or non-zero. The return code is in $? in
most other shells.
Based on my linux man page here the file named with -f should be an
INPUT file that exists but you've provided a name that looks more
like an output file. I'm not sure you should be using both "message"
and "-f". There are some other issues that affect where your message
might end up after you enter it.
Have a look in /var/adm/messages just after running logger.
--
Elvis Notargiacomo master AT barefaced DOT cheek
http://www.notatla.org.uk/goen/
|
|
0
|
|
|
|
Reply
|
elvis
|
7/28/2004 9:27:32 AM
|
|
> >I try to use the "logger" command, because I would like to add some log
in a
> >file, but it doesn't work. I had a look in the man, and tried :
> >
> >%> logger -t myTag -f /var/adm/myfile message
> >
> >Normaly. it must return a value: 0 if everything's ok or >0 if there was
a
> >problem, but for me, it returns nothing at all. And it didn't add the log
in
> >the file sure.
> >What's the problem ?
>
> Right after you've run this try "echo $status" (I'm guessing csh
> from your prompt). That should show the return value and it should
> be a number - either zero or non-zero. The return code is in $? in
> most other shells.
When I run echo $? (bash), it returns 0.
> Based on my linux man page here the file named with -f should be an
> INPUT file that exists but you've provided a name that looks more
> like an output file. I'm not sure you should be using both "message"
> and "-f". There are some other issues that affect where your message
> might end up after you enter it.
myfile is my input file. It is the log file where I want to add my personnal
log.
> Have a look in /var/adm/messages just after running logger.
I tried as well: %> logger -t myTag message
Nothing added in messages.....
--
Bc.
|
|
0
|
|
|
|
Reply
|
Bc
|
7/28/2004 10:23:13 AM
|
|
Bc. <moimoi.toi2@laposte.net> wrote:
> myfile is my input file. It is the log file where I want to add my personnal
> log.
I'm not sure if you really understood what the -f option is there for.
logger will read this file, and send its contents to the syslog daemon.
logger will not write anything to any file.
>> Have a look in /var/adm/messages just after running logger.
>
> I tried as well: %> logger -t myTag message
> Nothing added in messages.....
Is syslogd running on your system ? logger will log its messages
by default to syslog's user.notice facility (read the syslog.conf
man page on what this means). The default syslog.conf will not
log user.notice messages anywhere, so either you tell logger to
use a different facility, e.g.:
logger -p daemon.notice message
(in a default Solaris setup, this message will show up in
/var/adm/messages). Or you have to modify /etc/syslog.conf
and send syslogd a HUP signal to make it log user.notice
to whatever file you like.
If you just want to add a line to an existing line, you probably
don't need logger at all, something like
echo "message" >> /my/log/file
would suffice.
mp.
--
Systems Administrator | Institute for Software Science | Univ. of Vienna
|
|
0
|
|
|
|
Reply
|
Martin
|
7/28/2004 10:58:03 AM
|
|
> Normaly. it must return a value: 0 if everything's ok or >0 if there was a
> problem, but for me, it returns nothing at all. And it didn't add the log
in
> the file sure.
> What's the problem ?
The `logger` command uses syslog facilities. Is syslog running?
|
|
0
|
|
|
|
Reply
|
UNIX
|
7/31/2004 9:13:10 AM
|
|
|
4 Replies
1077 Views
(page loaded in 0.051 seconds)
Similiar Articles: [command] logger ? - comp.unix.solarisHello, I try to use the "logger" command, because I would like to add some log in a file, but it doesn't work. I had a look in the man, and tried : ... sftp-server logging in solaris 10 - comp.unix.solarisCan sftp-server logging be enabled under Sun SSH and Solaris 10? The standard OpenSSH method, via sftp-server command line options (e.g., -f facilit... Logging non interactive ssh sessions - comp.unix.solaris ...[command] logger ? - comp.unix.solaris [command] logger ? - comp.unix.solaris Logging non interactive ssh sessions - comp.unix.solaris ... system by adding a command to the ... syslogd not logging anymore - comp.unix.solarisIf you don't get anything useful back, try running syslogd with the -d flag and then send a logger command at it and watch what syslogd reports. sftp logging! - comp.unix.solarissftp-server logging in solaris 10 - comp.unix.solaris Can sftp-server logging be enabled under Sun SSH and Solaris 10? The standard OpenSSH method, via sftp-server command ... Logging Link Status (4506) To Console - comp.dcom.sys.cisco ...I would like to see up/down notfication on the console for ports. However, it seems the 4506 ships by default with this off. I have been unable to find the command to ... Flarcreate command on Solaris 8 - comp.unix.solarisSFTP in chroot on Solaris 10? - comp.unix.solaris sFTP log file - comp.unix.solaris [command] logger ? - comp.unix.solaris Hello, I try to use the "logger" command ... SOLARIS 8 FTP LOGGING - comp.unix.solarisNov 19 17:32:34 esacom73 in.ftpd[4794]: [ID 577562 daemon.debug] command: USER The ... SOLARIS 8 FTP LOGGING - comp.unix.solaris Hi All I have configured a Solaris 8 box ... Is there a Redo command? - comp.groupware.lotus-notes.misc ...syslogd not logging anymore - comp.unix.solaris Is there a Redo command? - comp.groupware.lotus-notes.misc ... syslogd not logging anymore - comp.unix.solaris to see if ... log4j:WARN No appenders could be found for logger. - comp.lang ...[command] logger ? - comp.unix.solaris I try to use the "logger" command, because I would like ... don't need logger at all, something like echo "message ... log4j:WARN No ... logger - Linux Command - Unix Command - Linux Operating System and ...Linux / Unix Command Library: logger. Learn about its synopsis, description, options, and examples. logger Commandlogger Command. Purpose. Makes entries in the system log. Syntax. logger [ -f File] [ -i] [-r [ Count ]] [ -p Priority] [ -t Tag] [ Message] Description 7/20/2012 8:21:35 AM
|