FileLogger Class
- java.
lang. Object - com.
microsoft. cognitiveservices. speech. diagnostics. logging. FileLogger
- com.
public final class FileLogger
A static class to control file-based SDK logging. Turning on logging while running your Speech SDK scenario provides detailed information from the SDK's core native components. If you report an issue to Microsoft, you may be asked to provide logs to help Microsoft diagnose the issue. Your application should not take dependency on particular log strings, as they may change from one SDK release to another without notice. FileLogger is the simplest logging solution and suitable for diagnosing most on-device issues when running Speech SDK. Added in version 1.42.0
File logging is a process wide construct. That means that if (for example) you have multiple speech recognizer objects running in parallel, there will be one log file containing interleaved logs lines from all recognizers. You cannot get a separate log file for each recognizer.
Method Summary
Modifier and Type | Method and Description |
---|---|
static void |
setFilters()
Clears filters for logging messages to a file. |
static void |
setFilters(String[] filters)
Sets filters for logging messages to a file. |
static void |
setLevel(Level level)
Sets the level of the messages to be captured by the logger. |
static void |
start(String filePath)
Start logging to a file without appending. |
static void |
start(String filePath, boolean append)
Starts logging to a file with an option to append. |
static void |
stop()
Stops logging to a file. |
Methods inherited from java.lang.Object
Method Details
setFilters
public static void setFilters()
Clears filters for logging messages to a file.
setFilters
public static void setFilters(String[] filters)
Sets filters for logging messages to a file. Once filters are set, file logger will only be updated with log strings containing at least one of the strings specified by the filters. The match is case sensitive.
Parameters:
setLevel
public static void setLevel(Level level)
Sets the level of the messages to be captured by the logger.
Parameters:
start
public static void start(String filePath)
Start logging to a file without appending.
Parameters:
start
public static void start(String filePath, boolean append)
Starts logging to a file with an option to append.
Parameters:
stop
public static void stop()
Stops logging to a file.
This call is optional. If logging has been started, the log file will be written when the process exits normally.
Applies to
Azure SDK for Java