• Issue with LogItem not getting database and agent

    By jett m parsley 1 decade ago

    I am using the openLog with Domino 8.5.1 and have run into some issues implementing the java logging for a scheduled agent. It appears that using the example of adding this line to the notesagent class:



    private OpenLogItem oli = new OpenLogItem();



    does not populate the LogEvent with the database/agent/user information. The issue is that in the OpenLogItem constructor it is using NotesFactory.createSession() to create the session, but it appears that the agentContext is null.



    Has anyone else solved this issue?









    starting to implement

    • alternative, not perfect

      By Fero Kossuth 1 decade ago

      found the same problem, I decided to declare new constructor signature:

      public OpenLogItem(Database db) throws NotesException {<br/>
          this(db.getParent());<br/>
          currentDatabase = db;<br/>
          thisDatabase = db.getFilePath();<br/>
      }<br/>
      



      It requires to add cast in default constructor:

      public OpenLogItem() {<br/>
          this((Session)null);<br/>
      }<br/>
      



      BTW, who needs (server,path) constructor?



      AgentContext is still null, though.



      I think that class needs some facelift:

      • static alternatives to logEvent/logError (I made proxy class for that)
      • ability to run in external Java (CORBA) - all those NotesFactory.createSession() calls fail. anybody using JUnit?
      • all those Vector warnings





        contact me if you want, I would like to help improve this project
    • See this other discussion item

      By Julian Robichaux 1 decade ago

      See the discussion on this here:



      http://www.openntf.org/projects/pmt.nsf/66d9103768cc2fed85256c59006b5433/6b804f851c540e4b862576e

      30053f5f5!OpenDocument



      This was something that changed in one of the recent client releases, from what people are reporting.