aboutsummaryrefslogtreecommitdiffhomepage
path: root/docs/content/en/troubleshooting/logging.md
blob: 8879c18463c56b6d3746327b9617a2b1c44567a3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
---
title: Logging
description: Enable logging to inspect events while building your site.
categories: [troubleshooting]
keywords: []
menu:
  docs:
    parent: troubleshooting
    weight: 30
weight: 30
toc: true
---

## Command line

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

Hugo has four logging levels:

error
: Display error messages only.

```sh
hugo --logLevel error
```

warn
: Display warning and error messages.

```sh
hugo --logLevel warn
```

info
: Display information, warning, and error messages.

```sh
hugo --logLevel info
```

debug
: Display debug, information, warning, and error messages.

```sh
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 >}}