FileLogger class
Leave feedback
On this page
Writes log messages to the file.
The FileLogger type exposes the following members:
| Constructor | Description |
|---|---|
| init | Initializes a logger that writes messages to a file. |
| Method | Description |
|---|---|
| error | Writes an error message to the console. Error log messages provide information about unrecoverable events in the application flow. |
| error_file | |
| error_string | |
| trace | Writes a trace message to the log. Trace log messages provide generally useful information about application flow. |
| trace_file | |
| trace_string | |
| warning | Writes a warning message to the console. |
| warning_file | |
| warning_string |
from groupdocs.viewer import Viewer, ViewerSettings
from groupdocs.viewer.logging import FileLogger
from groupdocs.viewer.options import HtmlViewOptions
viewer_settings = ViewerSettings(logger=FileLogger("./log.txt"))
with Viewer("./sample.docx", settings=viewer_settings) as viewer:
html_options = HtmlViewOptions.for_embedded_resources(
"write_logs_to_file/page_{0}.html"
)
viewer.view(html_options)
- module
groupdocs.viewer.logging
Was this page helpful?
Any additional feedback you'd like to share with us?
Please tell us how we can improve this page.
Thank you for your feedback!
We value your opinion. Your feedback will help us improve our documentation.