biz.neustar.loggly
Class LogglyHandler

java.lang.Object
  extended by java.util.logging.Handler
      extended by biz.neustar.loggly.LogglyHandler

public class LogglyHandler
extends Handler

A handler for JDK logging that sends JSON-formatted messages to Loggly.


Constructor Summary
LogglyHandler(String inputUrl)
          Creates a handler with the specified input URL, 10 threads, and support for 5000 messages in the backlog.
LogglyHandler(String inputUrl, int maxThreads, int backlog)
          Creates a handler with the specified input URL, max thread count, and message backlog support.
 
Method Summary
 void close()
           
 void flush()
           
 void publish(LogRecord record)
           
 
Methods inherited from class java.util.logging.Handler
getEncoding, getErrorManager, getFilter, getFormatter, getLevel, isLoggable, reportError, setEncoding, setErrorManager, setFilter, setFormatter, setLevel
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LogglyHandler

public LogglyHandler(String inputUrl)
Creates a handler with the specified input URL, 10 threads, and support for 5000 messages in the backlog.

Parameters:
inputUrl - - the URL provided by Loggly for sending log messages to
See Also:
LogglyHandler(String, int, int)

LogglyHandler

public LogglyHandler(String inputUrl,
                     int maxThreads,
                     int backlog)
Creates a handler with the specified input URL, max thread count, and message backlog support.

Parameters:
inputUrl - - the URL provided by Loggly for sending log messages to
maxThreads - - the max number of concurrent background threads that are allowed to send data to Loggly
backlog - - the max number of log messages that can be queued up (anything beyond will be thrown away)
Method Detail

publish

public void publish(LogRecord record)
Specified by:
publish in class Handler

flush

public void flush()
Specified by:
flush in class Handler

close

public void close()
           throws SecurityException
Specified by:
close in class Handler
Throws:
SecurityException


Copyright © 2011. All Rights Reserved.