Re: [systemd-devel] Systemd logging..

2018-11-22 Thread Tomasz Torcz
On Wed, Nov 21, 2018 at 02:23:50PM +0530, deepan muthusamy wrote:
> Hi,
> How to log systemd service into log.txt file.
> This file should be available after system  restart also.
> How to do this?

  You can use file:path in StandardOutput=
  
https://www.freedesktop.org/software/systemd/man/systemd.exec.html#StandardOutput=

-- 
Tomasz Torcz"Funeral in the morning, IDE hacking
xmpp: zdzich...@chrome.plin the afternoon and evening." - Alan Cox

___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] Systemd logging..

2018-11-22 Thread Cristian Rodríguez



El 21-11-2018 a las 11:08, deepan muthusamy escribió:


 > Can u please tell me what are all the things I have to add in .service

file to store all logs into a log file.


Some daemons provide an option to log to file, use that if available, 
otherwise make your program write debug or log messages to stderr and 
the journal will capture it.. then you can extract them to a text file.


___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] Systemd logging..

2018-11-21 Thread Reindl Harald


Am 21.11.18 um 15:08 schrieb deepan muthusamy:
> Hi,
> Still iam not clear about what to do in service.
> 
> Can u please tell me what are all the things I have to add in .service

what exactly did you not understand in my repsonse that you need to use
rsyslog for traditional logfiles and why do you respond to your own post
instead already existing answers?

> file to store all logs into a log file.
> 
> On Wed, 21 Nov 2018, 2:23 pm deepan muthusamy   wrote:
> 
> Hi, 
> How to log systemd service into log.txt file.
> This file should be available after system  restart also.
> How to do this?
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] Systemd logging..

2018-11-21 Thread deepan muthusamy
Hi,
Still iam not clear about what to do in service.

Can u please tell me what are all the things I have to add in .service file
to store all logs into a log file.

On Wed, 21 Nov 2018, 2:23 pm deepan muthusamy  Hi,
> How to log systemd service into log.txt file.
> This file should be available after system  restart also.
> How to do this?
>
>
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] Systemd logging..

2018-11-21 Thread Reindl Harald


Am 21.11.18 um 09:53 schrieb deepan muthusamy:
> How to log systemd service into log.txt file.
> This file should be available after system  restart also.
> How to do this?
just use rsyslog a all the years before

rsyslog.conf:
$MainMsgQueueSize 10
$WorkDirectory /var/lib/rsyslog
module(load="imjournal" StateFile="imjournal.state"
WorkAroundJournalBug="on")
$ActionFileDefaultTemplate RSYSLOG_TraditionalFileFormat
$MaxMessageSize 4096
:programname, isequal, "dhcpd" -/var/log/dhcpd.log
:programname, isequal, "dhcpd" stop


___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/systemd-devel


[systemd-devel] Systemd logging..

2018-11-21 Thread deepan muthusamy
Hi,
How to log systemd service into log.txt file.
This file should be available after system  restart also.
How to do this?
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] Systemd Logging

2012-03-26 Thread Lennart Poettering
On Thu, 22.03.12 16:28, Jack Wu (jack.nan...@gmail.com) wrote:

Please do not send HTML mail.

> I apologize for spamming.
> 
> I have a question for systemd logging.
> 
> Given the same verbosity level, less logs are shown on console when the
> logs (of a systemd service) are directed to ‘stdout’ instead of
> ‘stderr’.

Hmm? Can you elaborate? if a service is started by systemd and has
stdout/stderr connected to the logs, then messages from them will be
handled exactly the same way, the fd is just duplicated.

I am not sure I grok your question though.

Lennart

-- 
Lennart Poettering - Red Hat, Inc.
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


[systemd-devel] Systemd Logging

2012-03-22 Thread Jack Wu
Hi,



I apologize for spamming.



I have a question for systemd logging.



Given the same verbosity level, less logs are shown on console when the
logs (of a systemd service) are directed to ‘stdout’ instead of ‘stderr’.

Is this the logging intent for systemd?



Would the logging volume be related to the ‘LogTarget’ enum?



*typedef enum LogTarget{*

*LOG_TARGET_CONSOLE,*

*LOG_TARGET_KMSG,*

*LOG_TARGET_SYSLOG,*

*LOG_TARGET_SYSLOG_OR_KMSG,*

*LOG_TARGET_AUTO, /* console if stderr is tty, SYSLOG_OR_KMSG
otherwise */*

*LOG_TARGET_NULL,*

*_LOG_TARGET_MAX,*

*_LOG_TARGET_INVALID = -1*

*}  LogTarget;*



Thank you,

Jack
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] systemd logging isl broken

2011-11-11 Thread Michael D. Berger
Thanks for your question, but, thinking my system was seriously
damaged for a number of reasons, I have blown it away and
installed F16_64.  It has its own problems, but so far
I have not done anything with systemd.  I will soon.
I was happy to see many fewer files in /etc/init.d/ .
Not that I don't like sysV, but I found the mixture,
shall we say, unaesthetic.

Mike.

--
Michael D. Berger
m.d.ber...@ieee.org
http://www.rosemike.net/
  

> -Original Message-
> From: 
> systemd-devel-bounces+m.d.berger=ieee@lists.freedesktop.or
> g 
> [mailto:systemd-devel-bounces+m.d.berger=ieee.org@lists.freede
> sktop.org] On Behalf Of Michal Schmidt
> Sent: Friday, November 11, 2011 10:19
> To: systemd-devel@lists.freedesktop.org
> Subject: Re: [systemd-devel] systemd logging isl broken
> 
> On 11/10/2011 05:47 PM, Michael D. Berger wrote:
> > This may be related to the problem repotred in
> >p4p1 changed to p2p1; works oddly
> > reported on:
> >us...@lists.fedoraproject.org
> 
> I don't see how network device naming is related to this.
> 
> >/bin/systemctl enable myDaemon.service
> >ln -s '/etc/systemd/system/myDaemon.service'
> > '/etc/systemd/system/multi-user.target.wants/myDaemon.service'
> >Failed to issue method call: Did not receive a reply. Possible 
> > causes
> > include: the remote application did not send a reply, the 
> message bus 
> > security policy blocked the reply, the reply timeout 
> expired, or the 
> > network connection was broken.
> 
> Does "systemctl" without parameters report an error too?
> Is it reproducible always?
> 
> Michal
> ___
> systemd-devel mailing list
> systemd-devel@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/systemd-devel
> 
> __ NOD32 6621 (2011) Information __
> 
> This message was checked by NOD32 antivirus system.
> http://www.eset.com
> 
> 

___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] systemd logging isl broken

2011-11-11 Thread Michal Schmidt

On 11/10/2011 05:47 PM, Michael D. Berger wrote:

This may be related to the problem repotred in
   p4p1 changed to p2p1; works oddly
reported on:
   us...@lists.fedoraproject.org


I don't see how network device naming is related to this.


   /bin/systemctl enable myDaemon.service
   ln -s '/etc/systemd/system/myDaemon.service'
'/etc/systemd/system/multi-user.target.wants/myDaemon.service'
   Failed to issue method call: Did not receive a reply. Possible causes
include: the remote application did not send a reply, the message bus
security policy blocked the reply, the reply timeout expired, or the network
connection was broken.


Does "systemctl" without parameters report an error too?
Is it reproducible always?

Michal
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


[systemd-devel] systemd logging isl broken

2011-11-10 Thread Michael D. Berger
This may be related to the problem repotred in
  p4p1 changed to p2p1; works oddly
reported on:
  us...@lists.fedoraproject.org

  [root@mbrc40 myDaemon]# make enable
  /bin/systemctl enable myDaemon.service
  ln -s '/etc/systemd/system/myDaemon.service'
'/etc/systemd/system/multi-user.target.wants/myDaemon.service'
  Failed to issue method call: Did not receive a reply. Possible causes
include: the remote application did not send a reply, the message bus
security policy blocked the reply, the reply timeout expired, or the network
connection was broken.
make: *** [enable] Error 1


The same things happens when I call "systemctl enable myDaemon.service"
directly, rather than in a Makefile.

Thanks for your suggestions.
Mike.
--
Michael D. Berger
m.d.ber...@ieee.org
http://www.rosemike.net/
 

___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel