On 04/08/2016 11:35 AM, Xen wrote:
I must say personally I feel "logger" is quite convenient, but you don't get to specify any alternative log file.
I know my "logger" messages end up in both /var/log/syslog and journalctl.
Personally I would prefer a more custom made or personal thing that logs only stuff that I want personally to be logged.
And not system wide or in that system wide log file.
Is there really not any simple way to achieve a modicum of features instead of outputting to a file directly?
Of course I could simply log to syslog (using logger, I didn't even know it existed) but here is the thing:
* if the log is voluminous, you would probably want something that is not into syslog, and that rotates
* if the log is not voluminous, you won't need rotation as much, and maybe simple file redirect would be sufficient.
So the moment you want more features, you probably have more log output, and when you have more log output, you probably don't want to log to syslog.
Solution? :-/.
I'm sorry, I don't see that you have a problem, other than what might be termed "failure of imagination". I don't mean that as a insult, its an observation I make very often, for example when MS-Windows peoeple say that Linux is unusable because it doesn't have MS-Office or MS-Money or Notepad. The fact of the matter is that the config file for the older syslog tools was remarkably flexible. For example, rsyslogd(8) points out there are vary many modules available, some of them relating to storage. If you dump the output into a sql database then you have a lot of GUI tools available to manipulate and report on that data, construct queries, set up triggers and filters. Personally I thin that's a bit heavy for home use, but in a corporate setting its a delight. Rsyslog can also read its input from plain text files. If that's all your application can do then you can 'convert' it to syslog style logging, perhaps to feed your database as above. Its also possible to take input from UNIX Sockets, which gets back to things that don't do syslog calls, but that's getting rather esoteric. But the most important aspect of rsyslog is that you can define output channels and the rules for what gets sent to them. This gives almost infinite flexibility. The simple case is to filter and send output to a tty port. I dump everything ("*.*") to tty12. YMMV. But quite apart from filtering the facility and level, you can also use a fifo or names pipe, and from there apply any tool such as grep, awk or similar. The filtering is a lot more than I can describe here, it really is a RTFM case. I'll just note that setting up regex is quite straight forward. The complete documentation can be found in the doc folder of the rsyslog distribution or online at http://www.rsyslog.com/doc After reading that you may come to see that rsyslog has a complete programming languages! Also see http://www.rsyslog.com/doc/v8-stable/configuration/modules/omprog.html http://www.rsyslog.com/doc/v8-stable/configuration/modules/ommail.html Personally I'd like a filter that ran the message stream though an external program then back into rsyslog to be sent elsewhere. Finally you an send the output of any of the above, fitlers and all, to a specific user. -- 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: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org