Hi everybody,
There is some undergoing work on the logging system in OpenSER and I feel that some issues should be publicly addressed before moving forward.
What we have now in openser: 1) two logging systems - syslog and standard error 2) message format - totally chaos.
What we want to fix: 1) a better way to make easy distinction between the logs from different levels (ERR, WARN, DBG, etc) 2) a standard message format that, independend of the logging support (syslog, stderr), will provide all the needed information (level and date at least).
Here is my suggestion:
1) logging and message format: There will be different macros for each log level and the message should include the module_name and function for a better tracking of the messages:
LOG_NOTICE("module_name:function: message") LOG_DBG("module_name:function: message") LOG_ERR("module_name:function: message") ......
2) logging backends: a) syslog syslog automatically logs the date, process and from syslog.conf, you can redirect the log in different files based on the log level, so here there is nothing to be changed. b) stderr we need to extend dprint() (logger function for stderr) to prefix to the log message the date and log level (as text). This will provide similar possibilities as for syslog. (a patch is already available for this on the tracker)
If there are some comments on the proposed solution or there is a better approach, please let me know as I want to move on with this topic.
Regards, Bogdan
Bogdan-Andrei Iancu wrote:
Hi everybody,
There is some undergoing work on the logging system in OpenSER and I feel that some issues should be publicly addressed before moving forward.
What we have now in openser:
- two logging systems - syslog and standard error
- message format - totally chaos.
What we want to fix:
- a better way to make easy distinction between the logs from
different levels (ERR, WARN, DBG, etc) 2) a standard message format that, independend of the logging support (syslog, stderr), will provide all the needed information (level and date at least).
Here is my suggestion:
- logging and message format:
There will be different macros for each log level and the message should include the module_name and function for a better tracking of the messages:
LOG_NOTICE("module_name:function: message") LOG_DBG("module_name:function: message") LOG_ERR("module_name:function: message")
is it possible to write a macro which sets "module_name" and "function" automatically?
regards klaus
......
- logging backends: a) syslog syslog automatically logs the date, process and from syslog.conf,
you can redirect the log in different files based on the log level, so here there is nothing to be changed. b) stderr we need to extend dprint() (logger function for stderr) to prefix to the log message the date and log level (as text). This will provide similar possibilities as for syslog. (a patch is already available for this on the tracker)
If there are some comments on the proposed solution or there is a better approach, please let me know as I want to move on with this topic.
Regards, Bogdan
Devel mailing list Devel@openser.org http://openser.org/cgi-bin/mailman/listinfo/devel
On Friday 13 July 2007, Klaus Darilion wrote:
Bogdan-Andrei Iancu wrote:
Hi everybody,
There is some undergoing work on the logging system in OpenSER and I feel that some issues should be publicly addressed before moving forward.
What we have now in openser:
- two logging systems - syslog and standard error
- message format - totally chaos.
What we want to fix:
- a better way to make easy distinction between the logs from
different levels (ERR, WARN, DBG, etc) 2) a standard message format that, independend of the logging support (syslog, stderr), will provide all the needed information (level and date at least).
Here is my suggestion:
- logging and message format:
There will be different macros for each log level and the message should include the module_name and function for a better tracking of the messages:
LOG_NOTICE("module_name:function: message") LOG_DBG("module_name:function: message") LOG_ERR("module_name:function: message")
is it possible to write a macro which sets "module_name" and "function" automatically?
It's possible with gcc macros to get the file and line number i think.
Cheers,
Henning
Henning Westerholt wrote:
On Friday 13 July 2007, Klaus Darilion wrote:
- logging and message format:
There will be different macros for each log level and the message should include the module_name and function for a better tracking of the messages:
LOG_NOTICE("module_name:function: message") LOG_DBG("module_name:function: message") LOG_ERR("module_name:function: message")
is it possible to write a macro which sets "module_name" and "function" automatically?
It's possible with gcc macros to get the file and line number i think.
Exactly that's the problem - those are macros which are not standard across compilers. For example SUNCC does not recognize them....
I admit it will be easier to have the macros, but if it is not something portable, I will prefer to avoid it.
regards, bogdan
On Friday 13 July 2007 10:39:40 Bogdan-Andrei Iancu wrote:
There is some undergoing work on the logging system in OpenSER and I feel that some issues should be publicly addressed before moving forward.
I would really like logging information that is readable for humans. Sometimes I have the feeling I'm looking at Klingon when trying to find out why something happened. What is going on I can find in network traces/looking at UA behaviour, but the why is often so difficult to find.
log4c or log4cpp might be useful: http://log4c.sourceforge.net/ http://log4cpp.sourceforge.net/
Hi,
yes, I already took a look, but I found them to heavy because they are to general. We do not need a replacement, but just to do a bit of cleanup ;).
Thanks and regards, Bogdan
Michel de Boer wrote:
log4c or log4cpp might be useful: http://log4c.sourceforge.net/ http://log4cpp.sourceforge.net/