Message6086

Author root@127.0.0.1
Recipients root@127.0.0.1
Date 2010-09-22.17:51:25
SpamBayes Score 2.8865799e-15
Marked as misclassified No
Message-id <1285177887.52.0.390209076403.issue1655@psf.upfronthosting.co.za>
In-reply-to
Content
I have a tomcat webapp that use Jython as scripting language (thank you!).

I run python script periodically and I use logging to save debug output to syslog.

When I start tomcat and execute the first time a python script that use logging, it work perfectly.
If I try to run the same script again, nothing is sent to the log handler anymore.
I tried all log level on many different log handler.
If I use an other script that use logging too, nothing appears.
I need to restart tomcat to be able to send log again.

If I change logging handler, from let say, syslog to a rotating file WITHOUT a tomcat restart. The handler will create the file, but nothing will be written into the file.
Like if a sub part of logging is impacted.

I asked m developers to use Jython in a way that everything is reset at each invocation of jython.
It's plugged into the webapp this way:

public void executeScriptFile(File scriptFile, Map<String, Object> parameterMap, OutputStream stdoutOutputStream, OutputStream stderrOutputStream) throws Exception {
         PythonInterpreter pythonInterpreter = new PythonInterpreter(); 
         pythonInterpreter.setErr(stderrOutputStream);
         pythonInterpreter.setOut(stdoutOutputStream);

         // I think there is some constant not shown here
         // but I think you can understand what they wanted to do here
         for (Map.Entry<String, Object> entry : parameterMap.entrySet()) {
           if (!entry.getKey().equals(PYTHON_SCRIPT_FILE_NAME_PARAMETER)) {
             pythonInterpreter.set(entry.getKey(), entry.getValue());
           }
         }
         pythonInterpreter.execfile(scriptFile.getPath());
         pythonInterpreter.cleanup();
         PyStringMap pyStringMap = (PyStringMap)pythonInterpreter.getLocals();
         pyStringMap.clear();
       }

I do not know if the problem is in the way jython is invoked or in the library itself.
Sorry, I'm a python developer, not a Java developer, I did not wrote the java part, so I might be confused about the java specific stuff.
History
Date User Action Args
2010-09-22 17:51:27root@127.0.0.1setrecipients: + root@127.0.0.1
2010-09-22 17:51:27root@127.0.0.1setmessageid: <1285177887.52.0.390209076403.issue1655@psf.upfronthosting.co.za>
2010-09-22 17:51:27root@127.0.0.1linkissue1655 messages
2010-09-22 17:51:25root@127.0.0.1create