Per Jessen schreef op 09-04-16 10:50:
Xen wrote:
I must say personally I feel "logger" is quite convenient, but you don't get to specify any alternative log file.
Yes, it writes to syslog, which by default is the systemd journal. If you want it written to a file, you need to install a syslog daemon and configure it to do that.
So I guess Carlos said you can have multiple destinations in your syslog daemon configuration. Otherwise.
You don't seem to have presented us with a problem yet? Log to syslog, then have your favourite syslog daemon write it to your favourite logfile. If you need to rotate it, add a config to /etc/logrotate.d.
Otherwise it could mean you would need an additional syslog daemon for every program you want to log. That defeats the purpose of having a centralized (local) daemon. It also makes it impossible for any *user* to create logging without being the system administrator. All not very flexible and I guess. I have said many times before perhaps: there is no middle ground between root and a regular user in a regular linux system. What if I write an application and I want to run it on a shell server on which I am just a guest. I want it to do logging within my personal user space. Now what? For me these are real uses cases (or could very well be, become). Now I need to ship my application with its own syslog daemon and logrotate facility? Maybe actually log4j also does those things so I don't need anything for java applications. Log4j obviously can provide asynchronous logging where the thread that writes to disk, is not the same as the thread that does the logging. But on Linux, I seem to be required to use existing daemons that are system-wide, I don't know. Logrotate, I've seen it, thanks. I could probably get it running with a custom config, and then use cron with a user crontab (even that I don't like). Ideally, if I wanted to deploy this and I could not depend on any java solution for instance, I would ship with my own versions of these programs as part of my package and try to get it running as a user. Just the way it would happen for me I guess. In the meantime I keep writing my own logging system (more or less) in every bash script I write, because I require different levels etc. Thus far I have never changed system-wide configs, because ... well.... they are system wide! And anything I do might not want to interfere with that :-/. -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org