RFC: Establishing logging standards

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/OpenBSC@lists.osmocom.org/.

Harald Welte laforge at gnumonks.org
Wed Oct 7 14:56:47 UTC 2009


Hi Zecke,

On Wed, Oct 07, 2009 at 10:38:04AM +0200, Holger Freyther wrote:
 
> I think in the next days I will go around the sourcecode and change a couple 
> of logging messages. My two primary goals are increase the usefulness to figure 
> out what was going wrong and the second to be able to put some of these into 
> the syslog. 

Thanks for addressing this.  I always wanted to get around to do it, but didn't
find time so far.

> Should we use DEBUG* to also log to syslog or introduce a new set of macros?

I think it would be best to introduce a new logging macro, and turn DEBUGP into
a backwards compatibility macro that then calls/uses the new logging macro to
print a DEBUG level message

There is some code for log file handling in ulogd
(http://git.netfilter.org/cgi-bin/gitweb.cgi?p=ulogd2), see ulogd_log() and
__ulog_log() in ulogd.h as well as __ulogd_log() in ulogd.c.  It already
handles logging to a runtime choice of either syslog or a dedicated text file.
This is a feature that I'd like to see in openbsc, too.

In addition to that, we should support enabling of certain log levels and log
'groups' (like syslog facility, but more fine grained) to print to the telnet
interface.

So from the telnet interface, I want to be able to use vty commands to do
things like
* enable "WARNING" level messages on this telnet vty for all groups (MM, CC, ...)
* enable "DEBUG" level messages on this telnet vty for one specific group (SMS)
* change the log level and log groups for the logfile

> Log Levels:
> 
> I think Harald has expressed the wish to introduce log levels. Should we 
> follow the log levels of syslog(3)?

yes.

> I would like to collect formats for various actions. Currently I'm thinking of 
> the following but would like to have more input.

all of those, plus

abis_nm needs formats for
* object class and object instance
* nm_state

since we probably need more and more of these, it might be interesting to think
of adding a new format character instead of %... % is already heavily used
especially in glibc.g

Regards,
-- 
- Harald Welte <laforge at gnumonks.org>           http://laforge.gnumonks.org/
============================================================================
"Privacy in residential applications is a desirable marketing option."
                                                  (ETSI EN 300 175-7 Ch. A6)




More information about the OpenBSC mailing list