ch.qos.logback.ext.loggly
Class AbstractLogglyAppender<E>

java.lang.Object
  extended by ch.qos.logback.core.spi.ContextAwareBase
      extended by ch.qos.logback.core.UnsynchronizedAppenderBase<E>
          extended by ch.qos.logback.ext.loggly.AbstractLogglyAppender<E>
All Implemented Interfaces:
ch.qos.logback.core.Appender<E>, ch.qos.logback.core.spi.ContextAware, ch.qos.logback.core.spi.FilterAttachable<E>, ch.qos.logback.core.spi.LifeCycle
Direct Known Subclasses:
LogglyAppender, LogglyBatchAppender

public abstract class AbstractLogglyAppender<E>
extends ch.qos.logback.core.UnsynchronizedAppenderBase<E>

Common base for Loggly appenders.

Author:
MÃ¥rten Gustafson, Les Hazlewood, Cyrille Le Clerc

Field Summary
static String DEFAULT_ENDPOINT_PREFIX
           
static String DEFAULT_LAYOUT_PATTERN
           
protected  String endpointUrl
           
protected  String inputKey
           
protected  ch.qos.logback.core.Layout<E> layout
           
protected  boolean layoutCreatedImplicitly
           
protected  Proxy proxy
           
protected static Charset UTF_8
           
 
Fields inherited from class ch.qos.logback.core.UnsynchronizedAppenderBase
name, started
 
Fields inherited from class ch.qos.logback.core.spi.ContextAwareBase
context
 
Constructor Summary
AbstractLogglyAppender()
           
 
Method Summary
protected  String buildEndpointUrl(String inputKey)
           
protected  ch.qos.logback.core.Layout<E> createLayout()
           
protected  void ensureLayout()
           
protected abstract  String getEndpointPrefix()
          Returns the URL path prefix for the Loggly endpoint to which the implementing class will send log events.
 String getEndpointUrl()
           
 int getHttpReadTimeoutInMillis()
           
 String getInputKey()
           
 ch.qos.logback.core.Layout<E> getLayout()
           
 String getPattern()
           
 String getProxyHost()
           
 int getProxyPort()
           
protected  String readResponseBody(InputStream input)
           
 void setEndpointUrl(String endpointUrl)
           
 void setHttpReadTimeoutInMillis(int httpReadTimeoutInMillis)
           
 void setInputKey(String inputKey)
           
 void setLayout(ch.qos.logback.core.Layout<E> layout)
           
 void setPattern(String pattern)
           
 void setProxyHost(String proxyHost)
           
 void setProxyPort(int proxyPort)
           
 void setProxyPort(String proxyPort)
           
 void start()
           
 void stop()
           
protected  byte[] toBytes(InputStream is)
           
 
Methods inherited from class ch.qos.logback.core.UnsynchronizedAppenderBase
addFilter, append, clearAllFilters, doAppend, getCopyOfAttachedFiltersList, getFilterChainDecision, getName, isStarted, setName, toString
 
Methods inherited from class ch.qos.logback.core.spi.ContextAwareBase
addError, addError, addInfo, addInfo, addStatus, addWarn, addWarn, getContext, getDeclaredOrigin, getStatusManager, setContext
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface ch.qos.logback.core.spi.ContextAware
addError, addError, addInfo, addInfo, addStatus, addWarn, addWarn, getContext, setContext
 

Field Detail

DEFAULT_ENDPOINT_PREFIX

public static final String DEFAULT_ENDPOINT_PREFIX
See Also:
Constant Field Values

DEFAULT_LAYOUT_PATTERN

public static final String DEFAULT_LAYOUT_PATTERN
See Also:
Constant Field Values

UTF_8

protected static final Charset UTF_8

endpointUrl

protected String endpointUrl

inputKey

protected String inputKey

layout

protected ch.qos.logback.core.Layout<E> layout

layoutCreatedImplicitly

protected boolean layoutCreatedImplicitly

proxy

protected Proxy proxy
Constructor Detail

AbstractLogglyAppender

public AbstractLogglyAppender()
Method Detail

start

public void start()
Specified by:
start in interface ch.qos.logback.core.spi.LifeCycle
Overrides:
start in class ch.qos.logback.core.UnsynchronizedAppenderBase<E>

stop

public void stop()
Specified by:
stop in interface ch.qos.logback.core.spi.LifeCycle
Overrides:
stop in class ch.qos.logback.core.UnsynchronizedAppenderBase<E>

toBytes

protected byte[] toBytes(InputStream is)
                  throws IOException
Throws:
IOException

readResponseBody

protected String readResponseBody(InputStream input)
                           throws IOException
Throws:
IOException

ensureLayout

protected final void ensureLayout()

createLayout

protected ch.qos.logback.core.Layout<E> createLayout()

buildEndpointUrl

protected String buildEndpointUrl(String inputKey)

getEndpointPrefix

protected abstract String getEndpointPrefix()
Returns the URL path prefix for the Loggly endpoint to which the implementing class will send log events. This path prefix varies for the different Loggly services. The final endpoint URL is built by concatenating the DEFAULT_ENDPOINT_PREFIX with the endpoint prefix from getEndpointPrefix() and the inputKey.

Returns:
the URL path prefix for the Loggly endpoint

getEndpointUrl

public String getEndpointUrl()

setEndpointUrl

public void setEndpointUrl(String endpointUrl)

getInputKey

public String getInputKey()

setInputKey

public void setInputKey(String inputKey)

getPattern

public String getPattern()

setPattern

public void setPattern(String pattern)

getLayout

public ch.qos.logback.core.Layout<E> getLayout()

setLayout

public void setLayout(ch.qos.logback.core.Layout<E> layout)

getProxyPort

public int getProxyPort()

setProxyPort

public void setProxyPort(int proxyPort)

setProxyPort

public void setProxyPort(String proxyPort)

getProxyHost

public String getProxyHost()

setProxyHost

public void setProxyHost(String proxyHost)

getHttpReadTimeoutInMillis

public int getHttpReadTimeoutInMillis()

setHttpReadTimeoutInMillis

public void setHttpReadTimeoutInMillis(int httpReadTimeoutInMillis)


Copyright © 2014-2015. All Rights Reserved.