02.05.2014 Views

CoreandServices.book - Ocean - Schlumberger

CoreandServices.book - Ocean - Schlumberger

CoreandServices.book - Ocean - Schlumberger

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

CoreLogger Class<br />

CoreLogger Class<br />

The <strong>Ocean</strong> CoreLogger class is a facade that adds convenience methods to Microsoft<br />

Enterprise Logging. The methods provide error, warning, information, and debug<br />

messages. The messages appear in the log file defined by the application configuration<br />

file.<br />

The CoreLogger class method definitions are:<br />

public class CoreLogger<br />

{<br />

Info (string msg);<br />

Info (string msg, string category);<br />

Warn (string msg);<br />

Warn (string msg, string category);<br />

Error (string msg);<br />

Error (string msg, string category);<br />

Error (string msg, Exception e);<br />

Error (string msg, string category, Exception e);<br />

Debug (string msg);<br />

DebugPublic (string msg);<br />

Write (string msg, string category, TraceEventType severity);<br />

}<br />

The log file name and location is controlled by the product family but is typically defined in<br />

the applications configuration file. Messages output to the log file will contain time,<br />

message category, username, network information, and the message text.<br />

The Debug method sends its output to the system standard output and the application log<br />

file. If you are running your application from Visual Studio, then you will see the debug<br />

messages in the Visual Studio Output tab frame.<br />

Messages in the application log file are categorized. The error, warning, and information<br />

messages appear in the General category by default or in a user controlled category if the<br />

category argument is passed. Debug messages appear in the Debug category. Providing<br />

your own category with messages you generate helps users view the contents of the file.<br />

3-42 <strong>Ocean</strong> Application Development Framework 2008.1<br />

<strong>Schlumberger</strong> Private

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!