Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 1.3.1
    • Fix Version/s: None
    • Component/s: Engine
    • Labels:
      None
    • Environment:
      Operating System: All
      Platform: All

      Description

      Unfortunately, the used LogSystem is unstable.
      1) SimpleLog4JSystems:

      • if runtime.log.logsystem.log4j.category is not set (default), the cast to
        string throws an NPE, when trying to init(), i.e. obtain the categoryname.
      • so first fix could be:

        Object categoryname = o rsvc.getProperty("runtime.log.logsystem.log4j.category");

      if ( categoryname != null )
      {
      logger = Logger.getLogger( categoryname.toString() );
      ...

      • if null, same issue applies to the logfile stuff
      • furthermore internalInit( logfile ) would throw an NPE from
        java.io.FileOutputStream.<init>
      • finally a log is there, but uninitialized (i.e. useless) and
      • a misleading "PANIC: ..." message is thrown to stdout

      almost the same counts for the Log4JLogSystem as well as the AvalonLogSystem ...

        Activity

        Hide
        Henning Schmiedehausen added a comment -

        Close all resolved issues for older releases.

        Show
        Henning Schmiedehausen added a comment - Close all resolved issues for older releases.
        Hide
        Daniel Rall added a comment -

        Okay Jens, thanks for closing the loop. For posterity's sake, the current
        incarnation of the code reads as follows, avoiding the toString() which was
        causing the NPE:

        String categoryname = (String)
        rsvc.getProperty("runtime.log.logsystem\.log4j.category");

        if ( categoryname != null )

        { logger = Category.getInstance( categoryname ); logVelocityMessage( 0, "SimpleLog4JLogSystem using category '" + categ\oryname + "'"); return; }
        Show
        Daniel Rall added a comment - Okay Jens, thanks for closing the loop. For posterity's sake, the current incarnation of the code reads as follows, avoiding the toString() which was causing the NPE: String categoryname = (String) rsvc.getProperty("runtime.log.logsystem\.log4j.category"); if ( categoryname != null ) { logger = Category.getInstance( categoryname ); logVelocityMessage( 0, "SimpleLog4JLogSystem using category '" + categ\oryname + "'"); return; }
        Hide
        Jens Elkner added a comment -

        Ehhhhm, well, this report was made a long time ago. Since nobody replied to this
        issue, I thought that nobody really cares about it. So at the time, when I
        used velocity I made a port which threw away all dependencies on the more
        or less useful (especially avalon) stuff and to use log4j directly and only.
        (see also proposal in bug report 19140)

        Since more than a year, I haven't used velocity anymore and thus can't give
        you more information wrt. this matter and unfortunately have no time to reproduce
        all the details again ... Sorry, about that

        Show
        Jens Elkner added a comment - Ehhhhm, well, this report was made a long time ago. Since nobody replied to this issue, I thought that nobody really cares about it. So at the time, when I used velocity I made a port which threw away all dependencies on the more or less useful (especially avalon) stuff and to use log4j directly and only. (see also proposal in bug report 19140) Since more than a year, I haven't used velocity anymore and thus can't give you more information wrt. this matter and unfortunately have no time to reproduce all the details again ... Sorry, about that
        Hide
        Daniel Rall added a comment -

        Jens, please provide a stack trace or log message(s) associated with this
        problem. I'm not seeing this sort of thing in today's code. Thanks!

        Show
        Daniel Rall added a comment - Jens, please provide a stack trace or log message(s) associated with this problem. I'm not seeing this sort of thing in today's code. Thanks!

          People

          • Assignee:
            Unassigned
            Reporter:
            Jens Elkner
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development