public class MetricsLoggingServiceImpl extends Object implements MetricsLoggingService
| Constructor and Description |
|---|
MetricsLoggingServiceImpl() |
| Modifier and Type | Method and Description |
|---|---|
org.slf4j.profiler.Profiler |
createNestedProfiler(String parentProfilerName,
String nestedProfilerName)
Create a sub profiler of an existing profiler
|
static MetricsLoggingServiceImpl |
getInstance()
Returns the singleton instance, and creates it if not existing yet
|
boolean |
isEnabled()
Returns
true if the logging is generally enabled; false otherwise. |
boolean |
isProfilingEnabled()
Returns
true if the profiler logging is generally enabled; false otherwise. |
void |
logContentEvent(String user,
String ipAddress,
String sessionID,
String nodeIdentifier,
String path,
String nodeType,
String logTemplate,
String... args)
Log some metric about a node.
|
void |
setIgnoreUsers(Set<String> ignoreUsers) |
void |
setLogTemplatesMap(Map<String,String> logTemplatesMap) |
org.slf4j.profiler.Profiler |
startProfiler(String profilerName)
Start a new profiler and return it to the caller.
|
void |
startProfiler(String profilerName,
String action)
Start a profiler and start the associated action (if the profilerName is not foudn it will create it)
|
void |
stopNestedProfiler(String parentProfilerName,
String nestedProfilerName)
Stop a nested profiler
|
void |
stopProfiler(String profilerName)
Stop all profiling for this profiler name
|
public static MetricsLoggingServiceImpl getInstance()
public void logContentEvent(String user, String ipAddress, String sessionID, String nodeIdentifier, String path, String nodeType, String logTemplate, String... args)
logContentEvent in interface MetricsLoggingServiceuser - user achieving the operationipAddress - ip address of the usersessionID - if available, the identifier of the session, otherwise null or an empty string is fine. Note
that if you use null it will be outputted verbatim in the log.nodeIdentifier - if available, the node identifier on which the event took place, otherwise nullpath - the node path on which the operation has been achievednodeType - the type of the nodelogTemplate - the name of the template log you want to use.args - variable list of arguments depending of the template you choosepublic void startProfiler(String profilerName, String action)
startProfiler in interface MetricsLoggingServiceprofilerName - name of the profiler you want to use or createaction - the action you want to profilepublic void stopProfiler(String profilerName)
stopProfiler in interface MetricsLoggingServiceprofilerName - the name of the profiler you want to stoppublic org.slf4j.profiler.Profiler createNestedProfiler(String parentProfilerName, String nestedProfilerName)
createNestedProfiler in interface MetricsLoggingServiceparentProfilerName - the parent profiler namenestedProfilerName - the sub profiler namepublic void stopNestedProfiler(String parentProfilerName, String nestedProfilerName)
stopNestedProfiler in interface MetricsLoggingServiceparentProfilerName - the parent profiler namenestedProfilerName - the sub profiler namepublic org.slf4j.profiler.Profiler startProfiler(String profilerName)
MetricsLoggingServicestartProfiler in interface MetricsLoggingServiceprofilerName - the new profiler you want to startpublic boolean isEnabled()
MetricsLoggingServicetrue if the logging is generally enabled; false otherwise.isEnabled in interface MetricsLoggingServicetrue if the logging is generally enabled; false otherwisepublic boolean isProfilingEnabled()
MetricsLoggingServicetrue if the profiler logging is generally enabled; false otherwise.isProfilingEnabled in interface MetricsLoggingServicetrue if the profiler logging is generally enabled; false otherwiseCopyright © 2004–2020 Jahia Solutions Group SA. All rights reserved.