|
Oracle Data-aware Controls Reference | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectoracle.dacf.util.errormanager.ErrorLoggerAdapter
oracle.dacf.util.errorloggers.OutputStreamLogger
The OutPutStreamLogger is a non-buffered logger class that writes error information to an OutputStream. This class extends ErrorLoggerAdapter, which defines an abstract non-buffered logger, and provides implementations of the addError and getName methods.
For example, the following logger code writes to an OutputStream. You can use it to write logging information to any Java Outputstream, for example, a socket, a file, and so on.
OutputStreamLogger logger = null; try { FileOutputStream fo = new FileOutputStream("tst.out"); logger = new OutputStreamLogger(fo); } catch (java.io.IOException e) { System.err.println("#$%%%$@%@|?!!!!"); } try { ErrorManager.addErrorLogger(logger); } catch (NameAlreadyRegisteredException e) { System.err.println("A Logger with this name is already registered."); return; } …………….. …………….. …………….. // close the OutputStream, to force flushing logger.closeOutputStream(); ErrorManager.removeErrorLogger(logger);
ErrorLogger
,
ErrorLoggerAdapter
Field Summary | |
static java.lang.String |
NAME
String returned by the getName() method. |
Constructor Summary | |
OutputStreamLogger(java.io.OutputStream os)
Public constructor which takes an OutputStream object; it will use the default character encoding. |
|
OutputStreamLogger(java.io.OutputStreamWriter ow)
Public constructor which takes an OutputStreamWriter object. |
Method Summary | |
void |
addError(ErrorMessage emsg)
When adding an error, the error severity, message text, and time stamp will be written to the OutputStream. |
void |
closeOutputStream()
Closes and flushes the OutputStream. |
java.lang.String |
getName()
Returns the unique name of the error logger. |
Methods inherited from class oracle.dacf.util.errormanager.ErrorLoggerAdapter |
findAllErrors, findErrors, findErrors, isBuffered, removeAllErrors, removeError |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static java.lang.String NAME
Constructor Detail |
public OutputStreamLogger(java.io.OutputStream os)
os
- the OutputStream or logging target.public OutputStreamLogger(java.io.OutputStreamWriter ow)
Method Detail |
public void addError(ErrorMessage emsg)
addError
in interface ErrorLogger
addError
in class ErrorLoggerAdapter
emsg
- the error message.public void closeOutputStream()
public java.lang.String getName()
|
Oracle Data-aware Controls Reference | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Copyright © 1997, 2003, Oracle. All rights reserved.