Class FileLogger
- java.lang.Object
-
- com.microsoft.cognitiveservices.speech.diagnostics.logging.FileLogger
-
public final class FileLogger extends Object
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.0File 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
All Methods Static Methods Concrete Methods Modifier and Type Method Description static voidsetFilters()Clears filters for logging messages to a file.static voidsetFilters(String[] filters)Sets filters for logging messages to a file.static voidsetLevel(Level level)Sets the level of the messages to be captured by the logger.static voidstart(String filePath)Start logging to a file without appending.static voidstart(String filePath, boolean append)Starts logging to a file with an option to append.static voidstop()Stops logging to a file.
-
-
-
Method Detail
-
start
public static void start(String filePath)
Start logging to a file without appending.- Parameters:
filePath- Path of resulting log file
-
start
public static void start(String filePath, boolean append)
Starts logging to a file with an option to append.- Parameters:
filePath- Path of resulting log fileappend- If true will append to file (if already exists). Otherwise will create a new file
-
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.
-
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:
filters- Filters to use, or an empty list to remove previously set filters.
-
setFilters
public static void setFilters()
Clears filters for logging messages to a file.
-
setLevel
public static void setLevel(Level level)
Sets the level of the messages to be captured by the logger.- Parameters:
level- Maximum level of detail to be captured by the logger.
-
-