__init__ constructor
Leave feedback
On this page
Initializes a logger that writes messages to a file.
def __init__(self, file_name):
...
| Parameter | Type | Description |
|---|---|---|
| file_name | str |
Full file name with path. |
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)
- class
FileLogger
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.