How to Log with Protomatter Syslog

1) Create the file:

import com.protomatter.syslog.Syslog;
import com.protomatter.syslog.Syslogger;

public final class SyslogSample {

  public static void main(final String[] args) throws Exception {
    final Syslogger logger = Syslog.getLogger(SyslogSample.class.getName());, "Hello World!");

  private SyslogSample() {


2) Create the syslog.xml file:

<?xml version="1.0" encoding="UTF-8"?>
<Syslog defaultMask="DEBUG">
  <Logger name="PrintWriterLog.out" class="com.protomatter.syslog.PrintWriterLog">
    <Policy class="com.protomatter.syslog.SimpleLogPolicy">

3) Compile the file.

4) Set the Syslog.config.xml system property to syslog.xml.

5) Launch the SyslogSample class.


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s