Class TicketLoggingHandler
An implementation of Handler
that logs to the ticket system.
It queues log entries and logs them in the background. The log entries
are added in the order received, regardless of priority.
Will first look for any open/hold/bounced ticket that is for the same brand, account, language, type, level, prefix, classname, method, and category. If found, it will annotate that ticket. If not found, it will create a new ticket.
To minimize resource consumption, this shares one ExecutorService
for all handlers,
which means tickets are fed to the master(s) sequentially, even across many
different connectors.
- Author:
- AO Industries, Inc.
-
Constructor Summary
ModifierConstructorDescriptionPublic constructor required so can be specified inlogging.properties
.protected
TicketLoggingHandler
(String summaryPrefix, AoservConnector connector, String categoryDotPath) -
Method Summary
Modifier and TypeMethodDescriptionprotected void
backgroundPublish
(Formatter formatter, LogRecord rec, String fullReport) void
close()
Clean-up this handler and any that were garbage collected.static String
generateActionSummary
(Formatter formatter, LogRecord rec) static TicketLoggingHandler
getHandler
(String summaryPrefix, AoservConnector connector, String categoryDotPath) Only one TicketLoggingHandler will be created per unique summaryPrefix, AoservConnector, and categoryDotPath.static String
getPriorityName
(Level level) Methods inherited from class com.aoapps.hodgepodge.logging.QueuedHandler
flush, newExecutor, publish, shutdownExecutor
Methods inherited from class java.util.logging.Handler
getEncoding, getErrorManager, getFilter, getFormatter, getLevel, isLoggable, reportError, setEncoding, setErrorManager, setFilter, setFormatter, setLevel
-
Constructor Details
-
TicketLoggingHandler
protected TicketLoggingHandler(String summaryPrefix, AoservConnector connector, String categoryDotPath) -
TicketLoggingHandler
Public constructor required so can be specified inlogging.properties
. Supports the following optional settings inlogging.properties
:(classname).summaryPrefix
- the summary prefix for tickets.(classname).username
- the username to login as. When not set, the username fromaoserv-client.properties
is used.(classname).password
- the password to login with. When not set, the password fromaoserv-client.properties
is used.(classname).categoryDotPath
- the category dot path for tickets.
- Throws:
ConfigurationException
-
-
Method Details
-
getHandler
public static TicketLoggingHandler getHandler(String summaryPrefix, AoservConnector connector, String categoryDotPath) Only one TicketLoggingHandler will be created per unique summaryPrefix, AoservConnector, and categoryDotPath. -
close
Clean-up this handler and any that were garbage collected.- Overrides:
close
in classQueuedHandler
- Throws:
SecurityException
-
backgroundPublish
protected void backgroundPublish(Formatter formatter, LogRecord rec, String fullReport) throws IOException, SQLException - Specified by:
backgroundPublish
in classQueuedHandler
- Throws:
IOException
SQLException
-
generateActionSummary
-
getPriorityName
-