hugo/docs/content/en/troubleshooting/logging.md
Bjørn Erik Pedersen 5fd1e74903
Merge commit '9b0050e9aabe4be65c78ccf292a348f309d50ccd' as 'docs'
```
git subtree add --prefix=docs/ https://github.com/gohugoio/hugoDocs.git master --squash
```

Closes #11925
2024-01-27 10:48:57 +01:00

1.1 KiB

title description categories keywords menu weight toc
Logging Enable logging to inspect events while building your site.
troubleshooting
docs
parent weight
troubleshooting 30
30 true

Command line

Enable console logging with the --logLevel command line flag.

Hugo has four logging levels:

error
Display error messages only.
hugo --logLevel error
warn
Display warning and error messages.
hugo --logLevel warn
info
Display information, warning, and error messages.
hugo --logLevel info
debug
Display debug, information, warning, and error messages.
hugo --logLevel debug

{{% note %}} If you do not specify a logging level with the --logLevel flag, warnings and errors are always displayed. {{% /note %}}

Template functions

You can also use template functions to print warnings or errors to the console. These functions are typically used to report data validation errors, missing files, etc.

{{< list-pages-in-section path=/functions/fmt filter=functions_fmt_logging filterType=include >}}