Who we are

We are the developers of Plastic SCM, a full version control stack (not a Git variant). We work on the strongest branching and merging you can find, and a core that doesn't cringe with huge binaries and repos. We also develop the GUIs, mergetools and everything needed to give you the full version control stack.

If you want to give it a try, download it from here.

We also code SemanticMerge, and the gmaster Git client.

Logging to the Event Log

Monday, March 24, 2008 Pablo Santos 0 Comments

By default Plastic server logs both activity and errors to a file (loader.log.txt) located at the server's installation directory.

Since Plastic uses log4net as logging mechanism, it is very flexible to customize logging messages and output.

The following script shows how to configure the log (editing loader.log.conf at server's directory) to output errors to the Windows Event Log.

<log4net>

<appender name="ConsoleAppender" type="log4net.Appender.ConsoleAppender">
<layout type="log4net.Layout.PatternLayout">
<conversionPattern value="%message%newline" />
</layout>
</appender>

<appender name="FileAppender" type="log4net.Appender.FileAppender">
<file value="loader.log.txt" />
<appendToFile value="true" />
<layout type="log4net.Layout.PatternLayout">
<conversionPattern value="%message%newline" />
</layout>
</appender>

<appender name="EventLogAppender" type="log4net.Appender.EventLogAppender" >
<threshold value="ERROR" />
<applicationName value="Plastic Server" />
<layout type="log4net.Layout.PatternLayout">
<conversionPattern value="%message%newline" />
</layout>
</appender>


<logger name="UpdatePerf">
<level value="INFO" />
</logger>

<logger name="Transaction">
<level value="INFO" />
</logger>

<logger name="Operations">
<level value="INFO" />
</logger>

<root>
<level value="ERROR" />
<appender-ref ref="FileAppender" />
<appender-ref ref="EventLogAppender" />
</root>


</log4net>


The sample also shows how to configure Plastic logging to work with selected sources. In this case we're selecting all the transaction, performance and operations sources.

We normally use the following conversionpattern to define appenders:

%date %thread %property{UserID} %property{TransactionID}
%property{ClientMachine} %-5level %logger -
Pablo Santos
I'm the CTO and Founder at Códice.
I've been leading Plastic SCM since 2005. My passion is helping teams work better through version control.
I had the opportunity to see teams from many different industries at work while I helped them improving their version control practices.
I really enjoy teaching (I've been a University professor for 6+ years) and sharing my experience in talks and articles.
And I love simple code. You can reach me at @psluaces.

0 comentarios: