Sebastien Alborini wrote:
> I think the logging process is too complex (four levels, Information
> Error Debug Warning), and few people use this complexity in jboss code.
> I would propose only 2 levels:
> - Information-Error always printed
> - Debug-Warning printed only if debug flag is true, this flag would be a
> parameter of ConsoleLogging (or Logger?), and could be toggled through
> jmx (let's advertise localhost:8082 !)

IMHO only two levels would be too crude for most people.
Generally I find a very simple logging system crippling.


> We should also review the code to see what we really want to print.
> Any comments?

I think some care is needed here.

<disclaimer>
I know _nothing_ about how the current logging in jBoss works.
</disclaimer>

The logging API should be stable: It is (should be) used throughout
the jBoss code. Changes might be trivial, but require a lot of editing.

We do not know what kinds of modules and plugings will be developed
in the future, so we cannot tell what logging requirements these
will have.

Fortunately we are not the first who have had to deal with these
problems.

One example of a succesful logging facility is the UN*X syslog
facility. Here, each log message is attributed by two numbers:
The first denotes the facility, and we might use some kind of logging
source instead.
The second number denotes the criticality level of the log message,
and is just a non-negative integer. The lowest numbers have well-defined
constants:
  LOG_EMERG         0  system is unusable
  LOG_ALERT         1  action must be taken immediately
  LOG_CRIT          2  critical conditions
  LOG_ERR           3  error conditions
  LOG_WARNING       4  warning conditions
  LOG_NOTICE        5  normal but significant condition
  LOG_INFO          6  informational
  LOG_DEBUG         7  debug-level messages
As can be seen, lower numbers mean more critical.
Anyone is free to define their own levels, for example:
  LOG_LOTSA_OUTPUT 12  for chasing hard-to-find bugs
The UN*X syslog facility also has a configuration file for defining
which messages should really be logged.

I would suggest that logging levels not be fixed, and that we
use an integer for denoting the level. Then we can define some
constants for well-known levels. People that want other levels
are then free to use other integers.

One of the trade-offs we have to make is between the flexibility
of the logging system and the ease of configuring the logging
system.

Just my 2 cents...


Best Regards,

Ole Husgaard.


--
--------------------------------------------------------------
To subscribe:        [EMAIL PROTECTED]
To unsubscribe:      [EMAIL PROTECTED]
Problems?:           [EMAIL PROTECTED]

Reply via email to