From: Rahul on
Robert Heller <heller(a)deepsoft.com> wrote in
news:efGdna24vP4Py5LRnZ2dnUVZ_gCdnZ2d(a)posted.localnet:

> man 1 logger
>
> logger -f logfile "foo long line"
> program | logger -f logfile

My testing shows that the -f option just writes *from* logfile and not
*to* logfile. The output always appears in /var/log/messages.

Not sure if this approach will work for my purposes then.


--
Rahul
From: Keith Keller on
On 2010-06-09, Rahul <nospam(a)nospam.invalid> wrote:
> Robert Heller <heller(a)deepsoft.com> wrote in
> news:efGdna24vP4Py5LRnZ2dnUVZ_gCdnZ2d(a)posted.localnet:
>
>> man 1 logger
>>
>> logger -f logfile "foo long line"
>> program | logger -f logfile
>
> My testing shows that the -f option just writes *from* logfile and not
> *to* logfile. The output always appears in /var/log/messages.
>
> Not sure if this approach will work for my purposes then.

It's not clear to me from the logger man page what -f is supposed to do,
but if you have control of /etc/syslog.conf it doesn't matter: simply
configure syslog to log to the file you want. Configure a facility (and
level if you want) in syslog.conf, and use that with the -p switch to
logger to log where you want.

The docs for the -f switch say:

-f file Log the specified file.

If I were writing the man page, and wanted to say that -f would send the
contents of file to syslog, I'd say "log the contents of the specified
file". Or, if I wanted to say that -f would send logs to the file, I'd
say "log to the specified file". I'm too lazy to dig up the source
code, so I don't know which of these -f is supposed to do. (My tests
didn't produce any interesting results.)

--keith

--
kkeller-usenet(a)wombat.san-francisco.ca.us
(try just my userid to email me)
AOLSFAQ=http://www.therockgarden.ca/aolsfaq.txt
see X- headers for PGP signature information

From: Rahul on
Keith Keller <kkeller-usenet(a)wombat.san-francisco.ca.us> wrote in
news:g555e7xcjp.ln2(a)goaway.wombat.san-francisco.ca.us:

> If I were writing the man page, and wanted to say that -f would send the
> contents of file to syslog, I'd say "log the contents of the specified
> file". Or, if I wanted to say that -f would send logs to the file, I'd
> say "log to the specified file". I'm too lazy to dig up the source
> code, so I don't know which of these -f is supposed to do. (My tests
> didn't produce any interesting results.)
>

I'm pretty sure it is log *from*. My tests (on both syslogd and rsyslogd)
produce the same result. Contents of the file get dumped into
/var/log/messages.

--
Rahul