Where is my log message when use with `logger' command

classic Classic list List threaded Threaded
252 messages Options
1234 ... 13
Reply | Threaded
Open this post in threaded view
|

Where is my log message when use with `logger' command

Billy.Zheng(zw963)

From logger command man:

>> logger - a shell command interface to the syslog(3) system log module

So, I want to use this command to write log to syslog.

following is a test:

$: echo 'some special log output' |logger

but, i could not found anything about my log in /var/log/.

thanks.

--
Geek, Rubyist, Emacser
Homepage: http://zw963.github.io

--
To unsubscribe, e-mail: [hidden email]
To contact the owner, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Where is my log message when use with `logger' command

Per Jessen
Billy.Zheng(zw963) wrote:

>
> From logger command man:
>
>>> logger - a shell command interface to the syslog(3) system log
>>> module
>
> So, I want to use this command to write log to syslog.
>
> following is a test:
>
> $: echo 'some special log output' |logger
>
> but, i could not found anything about my log in /var/log/.
>

>From the man page:

logger [options] [message]

For your test to work:

$: echo 'some special log output' | xargs logger



--
Per Jessen, Zürich (6.0°C)
http://www.dns24.ch/ - your free DNS host, made in Switzerland.

--
To unsubscribe, e-mail: [hidden email]
To contact the owner, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Where is my log message when use with `logger' command

Anton Aylward-2
On 02/28/2016 10:35 AM, Per Jessen wrote:

> Billy.Zheng(zw963) wrote:
>
>>
>> From logger command man:
>>
>>>> logger - a shell command interface to the syslog(3) system log
>>>> module
>>
>> So, I want to use this command to write log to syslog.
>>
>> following is a test:
>>
>> $: echo 'some special log output' |logger
>>
>> but, i could not found anything about my log in /var/log/.
>>
>
>>From the man page:
>
> logger [options] [message]
>
> For your test to work:
>
> $: echo 'some special log output' | xargs logger

Yes, that, and have the settings in whatever you are using as a log
daemon configured appropriately :-)


--
         A: Yes.
     >   Q: Are you sure?
     >>  A: Because it reverses the logical flow of conversation.
     >>> Q: Why is top posting frowned upon?

--
To unsubscribe, e-mail: [hidden email]
To contact the owner, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Where is my log message when use with `logger' command

Carlos E. R.-2
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

On 2016-02-28 16:38, Anton Aylward wrote:
> On 02/28/2016 10:35 AM, Per Jessen wrote:
>> Billy.Zheng(zw963) wrote:

>> For your test to work:
>>
>> $: echo 'some special log output' | xargs logger
>
> Yes, that, and have the settings in whatever you are using as a
> log daemon configured appropriately :-)

Meaning journalctl for most people ;-)

- --
Cheers / Saludos,

                Carlos E. R.

  (from 13.1 x86_64 "Bottle" (Minas Tirith))
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.22 (GNU/Linux)

iF4EAREIAAYFAlbTFkIACgkQja8UbcUWM1x5dAD+P+Zg4Mic4JrCMCnFuTNTCbkx
04eef0Ip+UF31eBxAdwBAJ2WcKW6XvG+SLTy3y3G++yb6GaqYQi8/37Imle47rK2
=bccu
-----END PGP SIGNATURE-----
--
To unsubscribe, e-mail: [hidden email]
To contact the owner, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Where is my log message when use with `logger' command

Luuk
In reply to this post by Per Jessen


On 28-02-16 16:35, Per Jessen wrote:

> Billy.Zheng(zw963) wrote:
>
>>  From logger command man:
>>
>>>> logger - a shell command interface to the syslog(3) system log
>>>> module
>> So, I want to use this command to write log to syslog.
>>
>> following is a test:
>>
>> $: echo 'some special log output' |logger
>>
>> but, i could not found anything about my log in /var/log/.
>>
> >From the man page:
>
> logger [options] [message]
>
> For your test to work:
>
> $: echo 'some special log output' | xargs logger
>
>
>

Could you explain why this xargs is needed?
(because it seems to work without it, on my system....)

opensuse:~ # echo 'TEST1' | logger
opensuse:~ # echo 'TEST2' | xargs logger
opensuse:~ # tail -2 /var/log/messages
2016-02-28T17:14:22.807347+01:00 opensuse luuk: TEST1
2016-02-28T17:14:33.648455+01:00 opensuse luuk: TEST2
opensuse:~ #



--
To unsubscribe, e-mail: [hidden email]
To contact the owner, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Where is my log message when use with `logger' command

Per Jessen
Luuk wrote:

>
>
> On 28-02-16 16:35, Per Jessen wrote:
>> Billy.Zheng(zw963) wrote:
>>
>>>  From logger command man:
>>>
>>>>> logger - a shell command interface to the syslog(3) system log
>>>>> module
>>> So, I want to use this command to write log to syslog.
>>>
>>> following is a test:
>>>
>>> $: echo 'some special log output' |logger
>>>
>>> but, i could not found anything about my log in /var/log/.
>>>
>> >From the man page:
>>
>> logger [options] [message]
>>
>> For your test to work:
>>
>> $: echo 'some special log output' | xargs logger
>>
>>
>>
>
> Could you explain why this xargs is needed?
> (because it seems to work without it, on my system....)
>

Yep, you're right, according to the man page, logger defaults to reading
from stdin when no message is specified and '-f' isn't used.

That would suggest the OP just needs to look in the right places to find
the messages logged.


--
Per Jessen, Zürich (5.4°C)
http://www.hostsuisse.com/ - virtual servers, made in Switzerland.

--
To unsubscribe, e-mail: [hidden email]
To contact the owner, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Where is my log message when use with `logger' command

Peter Ragosch-2
In reply to this post by Billy.Zheng(zw963)
Am Sun, 28 Feb 2016 23:31:28 +0800
schrieb "Billy.Zheng(zw963)" <[hidden email]>:

>
> From logger command man:
>
> >> logger - a shell command interface to the syslog(3) system log
> >> module
>
> So, I want to use this command to write log to syslog.
>
> following is a test:
>
> $: echo 'some special log output' |logger
>
> but, i could not found anything about my log in /var/log/.
>
> thanks.
>
Enter in first user terminal:

peter@raven:~> sudo journald -f

to follow last log entries, then
enter in second user terminal

peter@raven:~> logger -i This is my message \(from user peter\)

you have to escape bash characters with special meaning (here the
brackets)

and you will got in the journal this entry

Feb 28 17:35:16 raven peter[21210]: This is my message (from user peter)

--
Mit freundlichen Grüßen
Kind Regards

Peter Ragosch

--
To unsubscribe, e-mail: [hidden email]
To contact the owner, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Where is my log message when use with `logger' command

Billy.Zheng(zw963)
This is not worked in openSUSE 42.1.
there is not exist a `journald' command.

This is not the answer i expected.

thanks.

Peter Ragosch writes:

> Am Sun, 28 Feb 2016 23:31:28 +0800
> schrieb "Billy.Zheng(zw963)" <[hidden email]>:
>
>>
>> From logger command man:
>>
>> >> logger - a shell command interface to the syslog(3) system log
>> >> module
>>
>> So, I want to use this command to write log to syslog.
>>
>> following is a test:
>>
>> $: echo 'some special log output' |logger
>>
>> but, i could not found anything about my log in /var/log/.
>>
>> thanks.
>>
> Enter in first user terminal:
>
> peter@raven:~> sudo journald -f
>
> to follow last log entries, then
> enter in second user terminal
>
> peter@raven:~> logger -i This is my message \(from user peter\)
>
> you have to escape bash characters with special meaning (here the
> brackets)
>
> and you will got in the journal this entry
>
> Feb 28 17:35:16 raven peter[21210]: This is my message (from user peter)
>
> --
> Mit freundlichen Grüßen
> Kind Regards
>
> Peter Ragosch

--
Geek, Rubyist, Emacser
Homepage: http://zw963.github.io

--
To unsubscribe, e-mail: [hidden email]
To contact the owner, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Where is my log message when use with `logger' command

Billy.Zheng(zw963)
In reply to this post by Per Jessen

>> echo 'some special log output' | xargs logger

My release is openSUSE 42.1,  where is my logger to find?

There is not exist a file named /var/log/messages (Like Slackware linux
I used.)


Per Jessen writes:

> Billy.Zheng(zw963) wrote:
>
>>
>> From logger command man:
>>
>>>> logger - a shell command interface to the syslog(3) system log
>>>> module
>>
>> So, I want to use this command to write log to syslog.
>>
>> following is a test:
>>
>> $: echo 'some special log output' |logger
>>
>> but, i could not found anything about my log in /var/log/.
>>
>
>>From the man page:
>
> logger [options] [message]
>
> For your test to work:
>
> $: echo 'some special log output' | xargs logger
>
>
>
> --
> Per Jessen, Zürich (6.0°C)
> http://www.dns24.ch/ - your free DNS host, made in Switzerland.

--
Geek, Rubyist, Emacser
Homepage: http://zw963.github.io

--
To unsubscribe, e-mail: [hidden email]
To contact the owner, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Where is my log message when use with `logger' command

Billy.Zheng(zw963)
In reply to this post by Luuk
Could you please tell me what version you use?

Why 42.1 can not find /var/log/messages ?

And, some service is not start correctly cause this file missing?

Thanks.

Luuk writes:

> On 28-02-16 16:35, Per Jessen wrote:
>> Billy.Zheng(zw963) wrote:
>>
>>>  From logger command man:
>>>
>>>>> logger - a shell command interface to the syslog(3) system log
>>>>> module
>>> So, I want to use this command to write log to syslog.
>>>
>>> following is a test:
>>>
>>> $: echo 'some special log output' |logger
>>>
>>> but, i could not found anything about my log in /var/log/.
>>>
>> >From the man page:
>>
>> logger [options] [message]
>>
>> For your test to work:
>>
>> $: echo 'some special log output' | xargs logger
>>
>>
>>
>
> Could you explain why this xargs is needed?
> (because it seems to work without it, on my system....)
>
> opensuse:~ # echo 'TEST1' | logger
> opensuse:~ # echo 'TEST2' | xargs logger
> opensuse:~ # tail -2 /var/log/messages
> 2016-02-28T17:14:22.807347+01:00 opensuse luuk: TEST1
> 2016-02-28T17:14:33.648455+01:00 opensuse luuk: TEST2
> opensuse:~ #

--
Geek, Rubyist, Emacser
Homepage: http://zw963.github.io

--
To unsubscribe, e-mail: [hidden email]
To contact the owner, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Where is my log message when use with `logger' command

Billy.Zheng(zw963)
In reply to this post by Per Jessen

> That would suggest the OP just needs to look in the right places to find
> the messages logged.

Where is the `correct place' to found the `logger' command message on
openSUSE 42.1?

Thanks.

Per Jessen writes:

> Luuk wrote:
>
>>
>>
>> On 28-02-16 16:35, Per Jessen wrote:
>>> Billy.Zheng(zw963) wrote:
>>>
>>>>  From logger command man:
>>>>
>>>>>> logger - a shell command interface to the syslog(3) system log
>>>>>> module
>>>> So, I want to use this command to write log to syslog.
>>>>
>>>> following is a test:
>>>>
>>>> $: echo 'some special log output' |logger
>>>>
>>>> but, i could not found anything about my log in /var/log/.
>>>>
>>> >From the man page:
>>>
>>> logger [options] [message]
>>>
>>> For your test to work:
>>>
>>> $: echo 'some special log output' | xargs logger
>>>
>>>
>>>
>>
>> Could you explain why this xargs is needed?
>> (because it seems to work without it, on my system....)
>>
>
> Yep, you're right, according to the man page, logger defaults to reading
> from stdin when no message is specified and '-f' isn't used.
>
> That would suggest the OP just needs to look in the right places to find
> the messages logged.
>
>
> --
> Per Jessen, Zürich (5.4°C)
> http://www.hostsuisse.com/ - virtual servers, made in Switzerland.

--
Geek, Rubyist, Emacser
Homepage: http://zw963.github.io

--
To unsubscribe, e-mail: [hidden email]
To contact the owner, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Where is my log message when use with `logger' command

jdd@dodin.org
Le 01/03/2016 19:29, Billy.Zheng (zw963) a écrit :
>
>> That would suggest the OP just needs to look in the right places to find
>> the messages logged.
>
> Where is the `correct place' to found the `logger' command message on
> openSUSE 42.1?

with Leap, use

journalctl

or dmesg

jdd



--
To unsubscribe, e-mail: [hidden email]
To contact the owner, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Where is my log message when use with `logger' command

Lew Wolfgang
On 03/01/2016 10:36 AM, jdd wrote:

> Le 01/03/2016 19:29, Billy.Zheng (zw963) a écrit :
>>
>>> That would suggest the OP just needs to look in the right places to find
>>> the messages logged.
>>
>> Where is the `correct place' to found the `logger' command message on
>> openSUSE 42.1?
>
> with Leap, use
>
> journalctl
>
> or dmesg
>

There are still some things that insist on finding /var/log/messages.  I've been
adding the "syslog-ng" package on 13.1 and 13.2.  Does this still work with Leap?

Regards,
Lew

--
To unsubscribe, e-mail: [hidden email]
To contact the owner, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Where is my log message when use with `logger' command

Billy.Zheng(zw963)
In reply to this post by Peter Ragosch-2
Hi, I have tried `journalctl -f' on SUSE 42.1, it seem like not work
correctly for me, it seem like journalctl only display logger from
terinal only if provide enough bytes content to logger command enough,
Otherwise, journalctl display nothings.


Is this expected behavior for journalctl ?

Thanks.


Peter Ragosch writes:

> Am Sun, 28 Feb 2016 23:31:28 +0800
> schrieb "Billy.Zheng(zw963)" <[hidden email]>:
>
>>
>> From logger command man:
>>
>> >> logger - a shell command interface to the syslog(3) system log
>> >> module
>>
>> So, I want to use this command to write log to syslog.
>>
>> following is a test:
>>
>> $: echo 'some special log output' |logger
>>
>> but, i could not found anything about my log in /var/log/.
>>
>> thanks.
>>
> Enter in first user terminal:
>
> peter@raven:~> sudo journald -f
>
> to follow last log entries, then
> enter in second user terminal
>
> peter@raven:~> logger -i This is my message \(from user peter\)
>
> you have to escape bash characters with special meaning (here the
> brackets)
>
> and you will got in the journal this entry
>
> Feb 28 17:35:16 raven peter[21210]: This is my message (from user peter)
>
> --
> Mit freundlichen Grüßen
> Kind Regards
>
> Peter Ragosch

--
Geek, Rubyist, Emacser
Homepage: http://zw963.github.io

--
To unsubscribe, e-mail: [hidden email]
To contact the owner, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Where is my log message when use with `logger' command

Carlos E. R.-2
In reply to this post by Billy.Zheng(zw963)
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

On 2016-03-01 19:25, Billy.Zheng (zw963) wrote:
> There is not exist a file named /var/log/messages (Like Slackware
> linux I used.)

Of course it doesn't. openSUSE uses systemd, meaning that there is no
syslog by default. You have to use instead the systemd log, which you
access via command "journalctl". Read its manual.

Alternatively, you can install a syslog daemon. syslog-ng, rsyslog...

- --
Cheers / Saludos,

                Carlos E. R.

  (from 13.1 x86_64 "Bottle" (Minas Tirith))
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.22 (GNU/Linux)

iF0EAREIAAYFAlbV9MwACgkQja8UbcUWM1wuLwD/dwk9rqrK+HvQiYa9uPjOYFMf
HiT+DOZgTwGtMjzNEi0A+PJ1A0qqj95ZFQsJWnT7NW3hC8knn4a6QWaVhzc44mM=
=QHJa
-----END PGP SIGNATURE-----
--
To unsubscribe, e-mail: [hidden email]
To contact the owner, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Where is my log message when use with `logger' command

Anton Aylward-2
In reply to this post by Billy.Zheng(zw963)
On 03/01/2016 01:22 PM, Billy.Zheng (zw963) wrote:
> This is not worked in openSUSE 42.1.
> there is not exist a `journald' command.
>
> This is not the answer i expected.

Well you could google, but this is the answer I prefer:

$ apropos journal
journalctl (1)       - Query the systemd journal
journald.conf (5)    - Journal service configuration file
ljlatest (6x)        - prints the most recent public posts on
livejournal.com.
named-journalprint (8) - print zone journal in human-readable form
systemd-cat (1)      - Connect a pipeline or program's output with the
journal
systemd-coredumpctl (1) - Retrieve coredumps from the journal
systemd-journalctl (1) - Query the systemd journal
systemd-journald (8) - Journal service
systemd-journald.service (8) - Journal service
systemd-journald.socket (8) - Journal service
systemd.journal-fields (7) - Special journal fields





--
         A: Yes.
     >   Q: Are you sure?
     >>  A: Because it reverses the logical flow of conversation.
     >>> Q: Why is top posting frowned upon?

--
To unsubscribe, e-mail: [hidden email]
To contact the owner, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Where is my log message when use with `logger' command

Anton Aylward-2
In reply to this post by Billy.Zheng(zw963)
On 03/01/2016 01:49 PM, Billy.Zheng (zw963) wrote:
> Hi, I have tried `journalctl -f' on SUSE 42.1, it seem like not work
> correctly for me, it seem like journalctl only display logger from
> terinal only if provide enough bytes content to logger command enough,
> Otherwise, journalctl display nothings.
>
>
> Is this expected behavior for journalctl ?

The behaviour of the journalling mechanism depends on the configuration,
which is very flexible.

See the man page for journald.conf

--
         A: Yes.
     >   Q: Are you sure?
     >>  A: Because it reverses the logical flow of conversation.
     >>> Q: Why is top posting frowned upon?

--
To unsubscribe, e-mail: [hidden email]
To contact the owner, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Where is my log message when use with `logger' command

Billy.Zheng(zw963)
In reply to this post by jdd@dodin.org
It's seem like dmesg is not work for `logger' command.

could you explain how to view logger output with dmesg command ?

I still not understood the difference about dmesg vs syslog.
and when to use either of each.

Thanks.

jdd writes:

> Le 01/03/2016 19:29, Billy.Zheng (zw963) a écrit :
>>
>>> That would suggest the OP just needs to look in the right places to find
>>> the messages logged.
>>
>> Where is the `correct place' to found the `logger' command message on
>> openSUSE 42.1?
>
> with Leap, use
>
> journalctl
>
> or dmesg
>
> jdd

--
Geek, Rubyist, Emacser
Homepage: http://zw963.github.io

--
To unsubscribe, e-mail: [hidden email]
To contact the owner, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Where is my log message when use with `logger' command

Billy.Zheng(zw963)
In reply to this post by Lew Wolfgang

I have install syslog-ng package for openSUSE leap 42.1.
It's seem like work perfect well for 42.1.

thanks.

Lew Wolfgang writes:

> On 03/01/2016 10:36 AM, jdd wrote:
>> Le 01/03/2016 19:29, Billy.Zheng (zw963) a écrit :
>>>
>>>> That would suggest the OP just needs to look in the right places to find
>>>> the messages logged.
>>>
>>> Where is the `correct place' to found the `logger' command message on
>>> openSUSE 42.1?
>>
>> with Leap, use
>>
>> journalctl
>>
>> or dmesg
>>
>
> There are still some things that insist on finding /var/log/messages.  I've been
> adding the "syslog-ng" package on 13.1 and 13.2.  Does this still work with Leap?
>
> Regards,
> Lew

--
Geek, Rubyist, Emacser
Homepage: http://zw963.github.io

--
To unsubscribe, e-mail: [hidden email]
To contact the owner, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Where is my log message when use with `logger' command

Per Jessen
In reply to this post by Billy.Zheng(zw963)
Billy.Zheng(zw963) wrote:

> It's seem like dmesg is not work for `logger' command.
>
> could you explain how to view logger output with dmesg command ?
>
> I still not understood the difference about dmesg vs syslog.
> and when to use either of each.

"man dmesg" - print or control the kernel ring buffer.

A syslog daemon writes all kinds of messages to persistent storage, e.g.
logfiles.  



--
Per Jessen, Zürich (3.6°C)
http://www.hostsuisse.com/ - virtual servers, made in Switzerland.

--
To unsubscribe, e-mail: [hidden email]
To contact the owner, e-mail: [hidden email]

1234 ... 13