# Can"t find the node-red logs

**URL:** https://discourse.nodered.org/t/can-t-find-the-node-red-logs/14324
**Category:** General
**Created:** [14 August 2019 17:27 UTC](https://discourse.nodered.org/t/can-t-find-the-node-red-logs/14324 "2019-08-14T17:27:14Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![doubleg](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/doubleg/32/10923_2.png) [@doubleg](https://discourse.nodered.org/u/doubleg)
#### Post date: [14 August 2019 17:27 UTC](https://discourse.nodered.org/t/can-t-find-the-node-red-logs/14324/1 "2019-08-14T17:27:14Z")

</div>

Hi everyone !

Is there some crash dump or log files in node-red?  
My node-red keep crashing and the cmd console suddently close so I can't see any error messages is there a way to view the logs?

- I'm on windows 10

---

<div class="post-metadata">

### Author: ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)
#### Post date: [14 August 2019 17:43 UTC](https://discourse.nodered.org/t/can-t-find-the-node-red-logs/14324/2 "2019-08-14T17:43:30Z")

</div>

No, not by default on windows.

You can start node-red and pipe the output to a file...

`node-red > log.txt`

---

<div class="post-metadata">

### Author: ![doubleg](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/doubleg/32/10923_2.png) [@doubleg](https://discourse.nodered.org/u/doubleg)
#### Post date: [14 August 2019 17:53 UTC](https://discourse.nodered.org/t/can-t-find-the-node-red-logs/14324/3 "2019-08-14T17:53:10Z")

</div>

Thank you Steve ! you are awesome !

---

<div class="post-metadata">

### Author: ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)
#### Post date: [15 August 2019 22:22 UTC](https://discourse.nodered.org/t/can-t-find-the-node-red-logs/14324/4 "2019-08-15T22:22:11Z")

</div>

> [@doubleg](#):
>
> My node-red keep crashing and the cmd console suddently close so I can't see any error messages is there a way to view the logs?

This only occurs if you are starting from a shortcut. Open a command prompt and run manually to see the logs.

Or, as Steve says, output to a file. However, you need to do a little more than Steve;s command because that may not give you error output.

I think you need something like:

```cmd
node-red >log.txt 2>&1

```

to get the error output as well.

---

<div class="post-metadata">

### Author: ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)
#### Post date: [16 August 2019 09:24 UTC](https://discourse.nodered.org/t/can-t-find-the-node-red-logs/14324/5 "2019-08-16T09:24:51Z")

</div>

> [@TotallyInformation](#):
>
> node-red \>log.txt 2\>&1

@TotallyInformation I'm not familiar with that syntax, could you "translate" it to human speak please 😃

---

<div class="post-metadata">

### Author: ![afelix](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/afelix/32/9743_2.png) [@afelix](https://discourse.nodered.org/u/afelix)
#### Post date: [16 August 2019 09:33 UTC](https://discourse.nodered.org/t/can-t-find-the-node-red-logs/14324/6 "2019-08-16T09:33:06Z")

</div>

The first `>` forwards the regular output (`stdout`) into a log file, the `2> &1` part will then push `stderr`, the error output to the same output as the standard output.

Additionally, I use a similar syntax in crontab sometimes. Cron is set up to send emails with all output, both `stdout` and `stderr`, of the commands executed through cron. As some of those can’t have the standard output quieted through a parameter, these commands are set up through `<command> > /dev/null 2> &1` meaning that only the `stderr` output will be mailed in case an error would have occurred.

---

<div class="post-metadata">

### Author: ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)
#### Post date: [16 August 2019 10:03 UTC](https://discourse.nodered.org/t/can-t-find-the-node-red-logs/14324/7 "2019-08-16T10:03:25Z")

</div>

You should note that this is standard across platforms, very similar if not the same for Linux/Mac/etc as well. In fact, I'm not sure whether it is part of the POSIX standards?

---

<div class="post-metadata">

### Author: ![afelix](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/afelix/32/9743_2.png) [@afelix](https://discourse.nodered.org/u/afelix)
#### Post date: [16 August 2019 10:17 UTC](https://discourse.nodered.org/t/can-t-find-the-node-red-logs/14324/8 "2019-08-16T10:17:35Z")

</div>

> [@TotallyInformation](#):
>
> In fact, I'm not sure whether it is part of the POSIX standards?

It's actually part of wider standards, but the syntax is shell based: `stdin`, `stdout` and `stderr` are considered the standard streams. The file descriptor for standard input (stdin) is defined as 0, for `stdout` it is 1, and `stderr` is 2. Redirecting these streams is done through the `<` and `>` syntax. In order to redirect the `stderr` stream, on a Bourne-style shell (so both `sh` and `bash`) you can use the file descriptor followed by the redirect syntax, so the regular `command > output` becomes `command 2> output`.

Bourne-style specifically defines `2> &1` as syntax to redirect the output of the `stderr` stream, the one with file descriptor 2, to the same output as file descriptor 1, the `stdout` stream. So to fix my previous statement, rather than outputting it to the command line it will redirect it to the same file descriptor as that log file that was defined.

See the wikipedia entries on this, they're actually quite good 🙂

> **[Standard streams | Background](https://en.wikipedia.org/wiki/Standard_streams#Background)**
>
> In most operating systems predating Unix, programs had to explicitly connect to the appropriate input and output devices. OS-specific intricacies caused this to be a tedious programming task. On many systems it was necessary to obtain control of environment settings, access a local file table, determine the intended data set, and handle hardware correctly in the case of a punch card reader, magnetic tape drive, disk drive, line printer, card punch, or interactive terminal.
> One of Unix's several ...

> **[Redirection (computing) | Redirecting to and from the standard file handles](https://en.wikipedia.org/wiki/Redirection_(computing)#Redirecting_to_and_from_the_standard_file_handles)**
>
> In Unix shells derived from the original Bourne shell, the first two actions can be further modified by placing a number (the file descriptor) immediately before the character; this will affect which stream is used for the redirection. The Unix standard I/O streams are:
