Carlos E. R. schreef op 11-04-16 02:20:
For instance "logger" is clearly not a complex tool. If it had a little more functionality, the same interface would be very easy to use in a script (or program).
What else do you want it to do? I use it often in scripts, that's what it is for.
Well of course it writes to the system syslog. I want something that can write to a file without having to configure it in syslog.
If every application writes its own logging framework, that's a lot of wasted effort. Apparently you want me to start exploring the source of e.g. squid to see how it does it. I would think people would know about these answers.
I gave you a dozen examples of programs you could examine. Yes, if I'm going to create a complicated application, certainly I will examine code examples I may reuse!
Well okay. But the reason for me asking was to discover whether that be necessary to begin with. See if you use log4j, there is no need for you to do anything. You can use it to log synchronously, asynchronously, to any database, to a syslog server, in any format you want, etc. etc. etc. But you understand.
Writing it yourself means spending an amount of time you were trying to avoid to see if something else did not already exist.
I use my own log often enough in my scripts. As simple as a simple function that calls "echo" with a timestamp and a file destination, that's all. I don't see the difficulty...
Of course, but the inquiry was about having more advanced features that syslog also provides. Without requiring syslog. If there is something easy to use, then I might be able to more easily incorporate it into my own scripts. Makes them less portable, but so be it. I have seen one such script I must say. I came across it when I was researching scripts that provide a more complete rsync experience. One of those scripts used its own logger script that was quite complete, I believe. Not sure though. Maybe I was mistaken and it just used the regular logger, which I did not know about.
You said, I think, you coded in Delphi. Then have a look at Lazarus, it is a multiplatform remake of Delphi. Just write to a text file with a cache. Or look in the examples to find something else...
No my friend, I do not need help into very basic logging principles, I was just inquiring whether something more fully developed would exist for Linux that was not the triade of syslog/cron/logrotate. If most people generally just go with syslog/cron/logrotate then no one might ever have found a need (or desire) for it. However if you say that many programs do bring their own system, then maybe we're missing something. Basic rotation would not be hard to implement in your own script, I concur, but it needs the work in any case and usually (thus far) I am not willing to put that much work into it. -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org