[Gambas-user] how to log to stdout/stderr

Tobias Boege taboege at ...626...
Thu Jul 13 22:11:00 CEST 2017


On Thu, 13 Jul 2017, PICCORO McKAY Lenz wrote:
> hello toby, when i set the gambas binary to backgroud to runs as daemon
> ...and lauch other gambas process from that gambas ...
> 
> then the stdout and stderr does not have that behaviour you said!
> so then?
> 

You're wrong, it does exactly what you wanted and specifically asked about:
print to stdout and stderr.

As we discussed recently [1], stdout and stderr are redirected to /dev/null
when you daemonise, so there is not really any value in wanting to print
there if you want to make a daemon.

If you still want the output of your system daemon to arrive somewhere, you
have to point stdout and stderr to somewhere meaningful again, like your
syslog. You can also make your own log files as was discussed in [1], if you
don't have a real *system* daemon that should be integrated into the systemd
(or what have you) ecosystem. There is information available about this on
the net [2], which is completely independent of Gambas, BTW.

There's an(other) old saying: If you want a good answer you have to ask a
very good question.

Regards,
Tobi

[1] https://sourceforge.net/p/gambas/mailman/gambas-user/thread/1498036647346-59450.post%40n7.nabble.com/#msg35904830
[2] https://stackoverflow.com/questions/17954432/creating-a-daemon-in-linux

-- 
"There's an old saying: Don't change anything... ever!" -- Mr. Monk




More information about the User mailing list