G
George Yang
Hello, Everyone,
I have got a problem with Apache's Logkit (ref.
http://www.apache.org/dist/avalon/logkit/binaries/).
I can use the kit with standalone application without any problems.
However, when I migrate the application to a server side, I couldn't delete
the produced log after the application finished.
On window PC, the system gives a Error that says "... There has been a
sharing violation. The source or destination file may be in use.".
After I have debugged on both Standalone mode and server side mode, I found
the behave of method Logger.getLogTargets() are different.
On standalone mode, it returns the LogTargets correctly so that I can close
the FileTarget before the application exits. On server side mode, it return
nothing so I can do nothing for the FileTarget, which remains open after
the application finished.
In the API, the method Logger.getLogTargets() is remarked as "Deprecated.
This method is deprecated and will be removed in Future version. Previously
it allowed unsafe access to logtargets which permitted masqurade attacks. It
currently returns a zero sized array.".
if so, how should I properly flush/close my log file? Has anyone got a idea?
Thanks in anticipation,
George
I have got a problem with Apache's Logkit (ref.
http://www.apache.org/dist/avalon/logkit/binaries/).
I can use the kit with standalone application without any problems.
However, when I migrate the application to a server side, I couldn't delete
the produced log after the application finished.
On window PC, the system gives a Error that says "... There has been a
sharing violation. The source or destination file may be in use.".
After I have debugged on both Standalone mode and server side mode, I found
the behave of method Logger.getLogTargets() are different.
On standalone mode, it returns the LogTargets correctly so that I can close
the FileTarget before the application exits. On server side mode, it return
nothing so I can do nothing for the FileTarget, which remains open after
the application finished.
In the API, the method Logger.getLogTargets() is remarked as "Deprecated.
This method is deprecated and will be removed in Future version. Previously
it allowed unsafe access to logtargets which permitted masqurade attacks. It
currently returns a zero sized array.".
if so, how should I properly flush/close my log file? Has anyone got a idea?
Thanks in anticipation,
George