HUGO
Menu
GitHub 90565 stars Mastodon

Logging

Enable logging to inspect events while building your project.

Command line

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

Hugo has four logging levels:

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

If you do not specify a logging level with the --logLevel flag, Hugo displays warning and error messages.

Template functions

Use these template functions to log messages to the console, such as data validation errors or missing files.

fmt.Errorf
Logs an ERROR from a template.
fmt.Erroridf
Logs a suppressible ERROR from a template.
fmt.Warnf
Logs a WARNING from a template.
fmt.Warnidf
Logs a suppressible WARNING from a template.

LiveReload

To log Hugo’s LiveReload requests in your browser, add this query string to the URL when running Hugo’s development server:

debug=LR-verbose

For example, visit this URL:

http://localhost:1313/?debug=LR-verbose

Then monitor the reload requests in the console of your browser’s developer tools. Enable the “preserve log” option in the developer tools.