Package org.logevents.observers
Class MicrosoftTeamsLogEventObserver
- java.lang.Object
-
- org.logevents.core.AbstractFilteredLogEventObserver
-
- org.logevents.observers.AbstractBatchingLogEventObserver
-
- org.logevents.observers.AbstractHttpPostJsonLogEventObserver
-
- org.logevents.observers.MicrosoftTeamsLogEventObserver
-
- All Implemented Interfaces:
LogEventObserver
public class MicrosoftTeamsLogEventObserver extends AbstractHttpPostJsonLogEventObserver
Sends log messages to Microsoft Teams through a webhook extension. Must be configured with a.url
property as a webhook. See Microsoft documentation on how to get a Webhook url. This observer batches messages as standard forAbstractBatchingLogEventObserver
, using theidleThreshold
,idleThreshold
, andcooldownTime
to determine when to flush the batch. It supportAbstractFilteredLogEventObserver
propertiesthreshold
,suppressMarkers
andrequireMarker
to filter sent messagesExample configuration:
observer.teams=SlackLogEventObserver observer.teams.url=https://outlook.office.com/webhook/.../IncomingWebHook/... observer.teams.format.detailUrl=link to your
LogEventsServlet
observer.teams.threshold=WARN observer.teams.suppressMarkers=BORING_MARKER observer.teams.requireMarker=MY_MARKER, MY_OTHER_MARKER observer.teams.cooldownTime=PT10S observer.teams.maximumWaitTime=PT5M observer.teams.idleThreshold=PT5S observer.teams.includedMdcKeys=clientIp observer.teams.markers.MY_MARKER.throttle=PT1M PT10M PT30M observer.teams.markers.MY_MARKER.mdc=userId observer.teams.proxy=proxy.example.net:8888Implementation notes
- Unfortunately, the ability to mention @channel is still Unavailable in Teams
-
-
Field Summary
-
Fields inherited from class org.logevents.observers.AbstractBatchingLogEventObserver
defaultBatcher, executor, scheduledExecutorService, shutdownHook
-
-
Constructor Summary
Constructors Constructor Description MicrosoftTeamsLogEventObserver(Map<String,String> properties, String prefix)
MicrosoftTeamsLogEventObserver(Configuration configuration)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected Map<String,Object>
formatBatch(LogEventBatch batch)
Override this method to customize how theLogEventBatch
will be formatted as JSON.-
Methods inherited from class org.logevents.observers.AbstractHttpPostJsonLogEventObserver
configureProxy, getProxy, getUrl, postJson, processBatch, sendBatch, toString
-
Methods inherited from class org.logevents.observers.AbstractBatchingLogEventObserver
configureBatching, configureMarkers, createBatcher, createMdcBatcher, createProcessor, doLogEvent, getBatcher, getBatcherFactory, getDefaultBatcher, getMarkerBatcher, processBatch
-
Methods inherited from class org.logevents.core.AbstractFilteredLogEventObserver
configureFilter, filteredOn, getCondition, getThreshold, isEnabled, logEvent, setCondition, setFilter, setThreshold, shouldLogEvent
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.logevents.LogEventObserver
isEnabled, stream, toList
-
-
-
-
Constructor Detail
-
MicrosoftTeamsLogEventObserver
public MicrosoftTeamsLogEventObserver(Map<String,String> properties, String prefix)
-
MicrosoftTeamsLogEventObserver
public MicrosoftTeamsLogEventObserver(Configuration configuration)
-
-
Method Detail
-
formatBatch
protected Map<String,Object> formatBatch(LogEventBatch batch)
Description copied from class:AbstractHttpPostJsonLogEventObserver
Override this method to customize how theLogEventBatch
will be formatted as JSON.- Specified by:
formatBatch
in classAbstractHttpPostJsonLogEventObserver
-
-