Package com.newrelic.api.agent
Interface Logger
-
public interface LoggerThe Java agent's logging interface. Use this interface to create entries in the Agent's log. By default, the Agent's log is written to the file newrelic_agent.log in the logs/ subdirectory at the Agent's install location.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description booleanisLoggable(java.util.logging.Level level)Returns true if the given log level will be logged.voidlog(java.util.logging.Level level, java.lang.String pattern)Concatenate the given parts and log them at the given level.voidlog(java.util.logging.Level level, java.lang.String pattern, java.lang.Object part1)Log a message at the given level using the provided pattern with one replacement.voidlog(java.util.logging.Level level, java.lang.String pattern, java.lang.Object[] msg)Do not use.voidlog(java.util.logging.Level level, java.lang.String pattern, java.lang.Object part1, java.lang.Object part2)Log a message at the given level using the provided pattern with two replacements.voidlog(java.util.logging.Level level, java.lang.String pattern, java.lang.Object part1, java.lang.Object part2, java.lang.Object part3)Log a message at the given level using the provided pattern with three replacements.voidlog(java.util.logging.Level level, java.lang.String pattern, java.lang.Object part1, java.lang.Object part2, java.lang.Object part3, java.lang.Object part4)Log a message at the given level using the provided pattern with four replacements.voidlog(java.util.logging.Level level, java.lang.String pattern, java.lang.Object part1, java.lang.Object part2, java.lang.Object part3, java.lang.Object part4, java.lang.Object part5)Log a message at the given level using the provided pattern with five replacements.voidlog(java.util.logging.Level level, java.lang.String pattern, java.lang.Object part1, java.lang.Object part2, java.lang.Object part3, java.lang.Object part4, java.lang.Object part5, java.lang.Object part6)Log a message at the given level using the provided pattern with six replacements.voidlog(java.util.logging.Level level, java.lang.String pattern, java.lang.Object part1, java.lang.Object part2, java.lang.Object part3, java.lang.Object part4, java.lang.Object part5, java.lang.Object part6, java.lang.Object part7)Log a message at the given level using the provided pattern with seven replacements.voidlog(java.util.logging.Level level, java.lang.String pattern, java.lang.Object part1, java.lang.Object part2, java.lang.Object part3, java.lang.Object part4, java.lang.Object part5, java.lang.Object part6, java.lang.Object part7, java.lang.Object... otherParts)Log a message at the given level using the provided pattern with seven + any other replacements.voidlog(java.util.logging.Level level, java.lang.Throwable t, java.lang.String pattern)Log a message with given Throwable information.voidlog(java.util.logging.Level level, java.lang.Throwable t, java.lang.String pattern, java.lang.Object part1)Log a message at the given level using the provided pattern and throwable with one replacement.voidlog(java.util.logging.Level level, java.lang.Throwable t, java.lang.String pattern, java.lang.Object[] msg)Do not use.voidlog(java.util.logging.Level level, java.lang.Throwable t, java.lang.String pattern, java.lang.Object part1, java.lang.Object part2)Log a message at the given level using the provided pattern and throwable with two replacements.voidlog(java.util.logging.Level level, java.lang.Throwable t, java.lang.String pattern, java.lang.Object part1, java.lang.Object part2, java.lang.Object part3)Log a message at the given level using the provided pattern and throwable with three replacements.voidlog(java.util.logging.Level level, java.lang.Throwable t, java.lang.String pattern, java.lang.Object part1, java.lang.Object part2, java.lang.Object part3, java.lang.Object part4)Log a message at the given level using the provided pattern and throwable with four replacements.voidlog(java.util.logging.Level level, java.lang.Throwable t, java.lang.String pattern, java.lang.Object part1, java.lang.Object part2, java.lang.Object part3, java.lang.Object part4, java.lang.Object part5)Log a message at the given level using the provided pattern and throwable with five replacements.voidlog(java.util.logging.Level level, java.lang.Throwable t, java.lang.String pattern, java.lang.Object part1, java.lang.Object part2, java.lang.Object part3, java.lang.Object part4, java.lang.Object part5, java.lang.Object part6)Log a message at the given level using the provided pattern and throwable with six replacements.voidlog(java.util.logging.Level level, java.lang.Throwable t, java.lang.String pattern, java.lang.Object part1, java.lang.Object part2, java.lang.Object part3, java.lang.Object part4, java.lang.Object part5, java.lang.Object part6, java.lang.Object part7)Log a message at the given level using the provided pattern and throwable with seven replacements.voidlog(java.util.logging.Level level, java.lang.Throwable t, java.lang.String pattern, java.lang.Object part1, java.lang.Object part2, java.lang.Object part3, java.lang.Object part4, java.lang.Object part5, java.lang.Object part6, java.lang.Object part7, java.lang.Object... otherParts)Log a message at the given level using the provided pattern and throwable with seven + any other replacements.voidlogToChild(java.lang.String childName, java.util.logging.Level level, java.lang.String pattern, java.lang.Object part1, java.lang.Object part2, java.lang.Object part3, java.lang.Object part4)Concatenate the given parts and log them at the given level.
-
-
-
Method Detail
-
isLoggable
boolean isLoggable(java.util.logging.Level level)
Returns true if the given log level will be logged. Generally this method should NOT be used - just call thelog(Level, String, Object...)methods with the message broken into parts. The overhead of the concatenation will not be incurred if the log level isn't met.- Parameters:
level- The level to be verified.- Returns:
- True if a message could be logged at the given level, else false.
- Since:
- 3.9.0
-
log
void log(java.util.logging.Level level, java.lang.String pattern, java.lang.Object[] msg)Do not use. This exists only for legacy reasons.- Parameters:
level- The level at which the message should be logged.pattern- A message format pattern in theMessageFormatstyle.msg- The parts to be placed in the log message using theMessageFormatstyle.
-
log
void log(java.util.logging.Level level, java.lang.String pattern)Concatenate the given parts and log them at the given level. If a part isnull, its value will be represented as "null". If a part is aClass, the value ofClass.getName()will be used.- Parameters:
level- The level at which the message should be logged.pattern- A message format pattern in theMessageFormatstyle.- Since:
- 3.9.0
-
log
void log(java.util.logging.Level level, java.lang.String pattern, java.lang.Object part1)Log a message at the given level using the provided pattern with one replacement.- Parameters:
level- The level at which the message should be logged.pattern- A message format pattern in theMessageFormatstyle.part1- The part to be replaced in the log message using theMessageFormatstyle
-
log
void log(java.util.logging.Level level, java.lang.String pattern, java.lang.Object part1, java.lang.Object part2)Log a message at the given level using the provided pattern with two replacements.- Parameters:
level- The level at which the message should be logged.pattern- A message format pattern in theMessageFormatstyle.part1- The part to be replaced in the log message using theMessageFormatstylepart2- The part to be replaced in the log message using theMessageFormatstyle
-
log
void log(java.util.logging.Level level, java.lang.String pattern, java.lang.Object part1, java.lang.Object part2, java.lang.Object part3)Log a message at the given level using the provided pattern with three replacements.- Parameters:
level- The level at which the message should be logged.pattern- A message format pattern in theMessageFormatstyle.part1- The part to be replaced in the log message using theMessageFormatstylepart2- The part to be replaced in the log message using theMessageFormatstylepart3- The part to be replaced in the log message using theMessageFormatstyle
-
log
void log(java.util.logging.Level level, java.lang.String pattern, java.lang.Object part1, java.lang.Object part2, java.lang.Object part3, java.lang.Object part4)Log a message at the given level using the provided pattern with four replacements.- Parameters:
level- The level at which the message should be logged.pattern- A message format pattern in theMessageFormatstyle.part1- The part to be replaced in the log message using theMessageFormatstylepart2- The part to be replaced in the log message using theMessageFormatstylepart3- The part to be replaced in the log message using theMessageFormatstylepart4- The part to be replaced in the log message using theMessageFormatstyle
-
log
void log(java.util.logging.Level level, java.lang.String pattern, java.lang.Object part1, java.lang.Object part2, java.lang.Object part3, java.lang.Object part4, java.lang.Object part5)Log a message at the given level using the provided pattern with five replacements.- Parameters:
level- The level at which the message should be logged.pattern- A message format pattern in theMessageFormatstyle.part1- The part to be replaced in the log message using theMessageFormatstylepart2- The part to be replaced in the log message using theMessageFormatstylepart3- The part to be replaced in the log message using theMessageFormatstylepart4- The part to be replaced in the log message using theMessageFormatstylepart5- The part to be replaced in the log message using theMessageFormatstyle
-
log
void log(java.util.logging.Level level, java.lang.String pattern, java.lang.Object part1, java.lang.Object part2, java.lang.Object part3, java.lang.Object part4, java.lang.Object part5, java.lang.Object part6)Log a message at the given level using the provided pattern with six replacements.- Parameters:
level- The level at which the message should be logged.pattern- A message format pattern in theMessageFormatstyle.part1- The part to be replaced in the log message using theMessageFormatstylepart2- The part to be replaced in the log message using theMessageFormatstylepart3- The part to be replaced in the log message using theMessageFormatstylepart4- The part to be replaced in the log message using theMessageFormatstylepart5- The part to be replaced in the log message using theMessageFormatstylepart6- The part to be replaced in the log message using theMessageFormatstyle
-
log
void log(java.util.logging.Level level, java.lang.String pattern, java.lang.Object part1, java.lang.Object part2, java.lang.Object part3, java.lang.Object part4, java.lang.Object part5, java.lang.Object part6, java.lang.Object part7)Log a message at the given level using the provided pattern with seven replacements.- Parameters:
level- The level at which the message should be logged.pattern- A message format pattern in theMessageFormatstyle.part1- The part to be replaced in the log message using theMessageFormatstylepart2- The part to be replaced in the log message using theMessageFormatstylepart3- The part to be replaced in the log message using theMessageFormatstylepart4- The part to be replaced in the log message using theMessageFormatstylepart5- The part to be replaced in the log message using theMessageFormatstylepart6- The part to be replaced in the log message using theMessageFormatstylepart7- The part to be replaced in the log message using theMessageFormatstyle
-
log
void log(java.util.logging.Level level, java.lang.String pattern, java.lang.Object part1, java.lang.Object part2, java.lang.Object part3, java.lang.Object part4, java.lang.Object part5, java.lang.Object part6, java.lang.Object part7, java.lang.Object... otherParts)Log a message at the given level using the provided pattern with seven + any other replacements.- Parameters:
level- The level at which the message should be logged.pattern- A message format pattern in theMessageFormatstyle.part1- The part to be replaced in the log message using theMessageFormatstylepart2- The part to be replaced in the log message using theMessageFormatstylepart3- The part to be replaced in the log message using theMessageFormatstylepart4- The part to be replaced in the log message using theMessageFormatstylepart5- The part to be replaced in the log message using theMessageFormatstylepart6- The part to be replaced in the log message using theMessageFormatstylepart7- The part to be replaced in the log message using theMessageFormatstyleotherParts- The other parts to be replaced in the log message using theMessageFormatstyle
-
log
void log(java.util.logging.Level level, java.lang.Throwable t, java.lang.String pattern, java.lang.Object[] msg)Do not use. This exists only for legacy reasons.- Parameters:
level- The level at which the message should be logged.t- The exception to be logged.pattern- A message format pattern in theMessageFormatstyle.msg- The parts to be placed in the log message using theMessageFormatstyle.
-
log
void log(java.util.logging.Level level, java.lang.Throwable t, java.lang.String pattern)Log a message with given Throwable information. Concatenate the given msg and log them at the given level. If a msg isnull, its value will be represented as "null". If a part is aClass, the value ofClass.getName()will be used.- Parameters:
level- The level at which the message should be logged.t- The exception to be logged.pattern- A message format pattern in theMessageFormatstyle.- Since:
- 3.9.0
-
log
void log(java.util.logging.Level level, java.lang.Throwable t, java.lang.String pattern, java.lang.Object part1)Log a message at the given level using the provided pattern and throwable with one replacement.- Parameters:
level- The level at which the message should be logged.t- The exception to be logged.pattern- A message format pattern in theMessageFormatstyle.part1- The part to be replaced in the log message using theMessageFormatstyle
-
log
void log(java.util.logging.Level level, java.lang.Throwable t, java.lang.String pattern, java.lang.Object part1, java.lang.Object part2)Log a message at the given level using the provided pattern and throwable with two replacements.- Parameters:
level- The level at which the message should be logged.t- The exception to be logged.pattern- A message format pattern in theMessageFormatstyle.part1- The part to be replaced in the log message using theMessageFormatstylepart2- The part to be replaced in the log message using theMessageFormatstyle
-
log
void log(java.util.logging.Level level, java.lang.Throwable t, java.lang.String pattern, java.lang.Object part1, java.lang.Object part2, java.lang.Object part3)Log a message at the given level using the provided pattern and throwable with three replacements.- Parameters:
level- The level at which the message should be logged.t- The exception to be logged.pattern- A message format pattern in theMessageFormatstyle.part1- The part to be replaced in the log message using theMessageFormatstylepart2- The part to be replaced in the log message using theMessageFormatstylepart3- The part to be replaced in the log message using theMessageFormatstyle
-
log
void log(java.util.logging.Level level, java.lang.Throwable t, java.lang.String pattern, java.lang.Object part1, java.lang.Object part2, java.lang.Object part3, java.lang.Object part4)Log a message at the given level using the provided pattern and throwable with four replacements.- Parameters:
level- The level at which the message should be logged.t- The exception to be logged.pattern- A message format pattern in theMessageFormatstyle.part1- The part to be replaced in the log message using theMessageFormatstylepart2- The part to be replaced in the log message using theMessageFormatstylepart3- The part to be replaced in the log message using theMessageFormatstylepart4- The part to be replaced in the log message using theMessageFormatstyle
-
log
void log(java.util.logging.Level level, java.lang.Throwable t, java.lang.String pattern, java.lang.Object part1, java.lang.Object part2, java.lang.Object part3, java.lang.Object part4, java.lang.Object part5)Log a message at the given level using the provided pattern and throwable with five replacements.- Parameters:
level- The level at which the message should be logged.t- The exception to be logged.pattern- A message format pattern in theMessageFormatstyle.part1- The part to be replaced in the log message using theMessageFormatstylepart2- The part to be replaced in the log message using theMessageFormatstylepart3- The part to be replaced in the log message using theMessageFormatstylepart4- The part to be replaced in the log message using theMessageFormatstylepart5- The part to be replaced in the log message using theMessageFormatstyle
-
log
void log(java.util.logging.Level level, java.lang.Throwable t, java.lang.String pattern, java.lang.Object part1, java.lang.Object part2, java.lang.Object part3, java.lang.Object part4, java.lang.Object part5, java.lang.Object part6)Log a message at the given level using the provided pattern and throwable with six replacements.- Parameters:
level- The level at which the message should be logged.t- The exception to be logged.pattern- A message format pattern in theMessageFormatstyle.part1- The part to be replaced in the log message using theMessageFormatstylepart2- The part to be replaced in the log message using theMessageFormatstylepart3- The part to be replaced in the log message using theMessageFormatstylepart4- The part to be replaced in the log message using theMessageFormatstylepart5- The part to be replaced in the log message using theMessageFormatstylepart6- The part to be replaced in the log message using theMessageFormatstyle
-
log
void log(java.util.logging.Level level, java.lang.Throwable t, java.lang.String pattern, java.lang.Object part1, java.lang.Object part2, java.lang.Object part3, java.lang.Object part4, java.lang.Object part5, java.lang.Object part6, java.lang.Object part7)Log a message at the given level using the provided pattern and throwable with seven replacements.- Parameters:
level- The level at which the message should be logged.t- The exception to be logged.pattern- A message format pattern in theMessageFormatstyle.part1- The part to be replaced in the log message using theMessageFormatstylepart2- The part to be replaced in the log message using theMessageFormatstylepart3- The part to be replaced in the log message using theMessageFormatstylepart4- The part to be replaced in the log message using theMessageFormatstylepart5- The part to be replaced in the log message using theMessageFormatstylepart6- The part to be replaced in the log message using theMessageFormatstylepart7- The part to be replaced in the log message using theMessageFormatstyle
-
log
void log(java.util.logging.Level level, java.lang.Throwable t, java.lang.String pattern, java.lang.Object part1, java.lang.Object part2, java.lang.Object part3, java.lang.Object part4, java.lang.Object part5, java.lang.Object part6, java.lang.Object part7, java.lang.Object... otherParts)Log a message at the given level using the provided pattern and throwable with seven + any other replacements.- Parameters:
level- The level at which the message should be logged.t- The exception to be logged.pattern- A message format pattern in theMessageFormatstyle.part1- The part to be replaced in the log message using theMessageFormatstylepart2- The part to be replaced in the log message using theMessageFormatstylepart3- The part to be replaced in the log message using theMessageFormatstylepart4- The part to be replaced in the log message using theMessageFormatstylepart5- The part to be replaced in the log message using theMessageFormatstylepart6- The part to be replaced in the log message using theMessageFormatstylepart7- The part to be replaced in the log message using theMessageFormatstyleotherParts- The other parts to be replaced in the log message using theMessageFormatstyle
-
logToChild
void logToChild(java.lang.String childName, java.util.logging.Level level, java.lang.String pattern, java.lang.Object part1, java.lang.Object part2, java.lang.Object part3, java.lang.Object part4)Concatenate the given parts and log them at the given level. If a part isnull, its value will be represented as "null". If a part is aClass, the value ofClass.getName()will be used.- Parameters:
childName- The name of the child logger.level- The level at which the message should be logged.pattern- A message format pattern in theMessageFormatstyle.part1- The part to be replaced in the log message using theMessageFormatstylepart2- The part to be replaced in the log message using theMessageFormatstylepart3- The part to be replaced in the log message using theMessageFormatstylepart4- The part to be replaced in the log message using theMessageFormatstyle- Since:
- 3.9.0
-
-