Krishna - 2004-06-08

Hi
We are using log4plsql with log4j to log messages to external appenders.
Appenders are getting the messages from log4plsql if the threshold is set.
If the threshold is set in log4j configuration file then appenders are not getting the messages.

Problem:
Levels in log4plsql using are
    10,OFF
    20,FATAL
    30,ERROR
    40,WARN
    50,INFO
    60,DEBUG
    70,ALL

which are different from Log4j
Log4j default level are :
    Integer.MAX_VALUE, OFF
    50000,FATAL
    40000,ERROR
    30000,WARN
    20000,INFO
    10000,DEBUG
        Integer.MIN_VALUE,ALL
       
And these are reverse orders also ( as compared with the levels log4plsql levels in the table).

Is it possible to change the code log4plsql Background process according to log4j levels?
   
    a).Instead of callAppenders in ReaderLogDatabase.sqlj

                switch (piped_LLEVEL) {
                    case 20:
                        dbLogger.fatal(piped_LTEXTE);
                        break;
                    case 30:
                        dbLogger.error(piped_LTEXTE);
                        break;
                    case 40:
                        dbLogger.warn(piped_LTEXTE);
                        break;
                    case 50:
                        dbLogger.info(piped_LTEXTE);
                break;
                    case 60:
                        dbLogger.debug(piped_LTEXTE);
                        break;
                    default:
                        dbLogger.error(piped_LTEXTE);
                           break;                       
              
      or
    b).    we can extend level class and write a new class for log4plsql for log4j and for setting threshold give the class         name in the configuration file. For this code change in log4plsql background process is

        public
              boolean isGreaterOrEqual(Priority r) {
                return r.isGreaterOrEqual(this);
            }

        As the check for the Priority is different for log4j and log4plsql.

or

Any other solution please let me know.

Thanks&Regards,
Ramakrishna.