# How to view stacktrace in Graylog

**URL:** <https://community.graylog.org/t/how-to-view-stacktrace-in-graylog/29228>\
**Category:** Graylog Central (peer support)\
**Tags:** gelf\
**Created:** [June 20, 2023, 6:52am UTC](https://community.graylog.org/t/how-to-view-stacktrace-in-graylog/29228 "2023-06-20T06:52:02Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![MacKnight](https://sea2.discourse-cdn.com/flex016/user_avatar/community.graylog.org/macknight/32/14974_2.png) [@MacKnight](https://community.graylog.org/u/MacKnight)\
**Post date:** [June 20, 2023, 6:52am UTC](https://community.graylog.org/t/how-to-view-stacktrace-in-graylog/29228/1 "2023-06-20T06:52:02Z")

</div>

1. No stack trace from GELF UDP transport. We are using a Winston logger.

2. ubuntu-20.04-server-20220607 - Kubernetes cluster v1

- Package Version: graylog:5.0  
env:  
- name: OPENSEARCH\_JAVA\_OPTS  
value: -Xms1g -Xmx1g  
- name: bootstrap.memory\_lock  
value: “true”  
- name: discovery.type  
value: single-node  
- name: action.auto\_create\_index  
value: “false”  
- name: plugins.security.ssl.http.enabled  
value: “false”  
- name: plugins.security.disabled  
value: “true”

1. Graylog UI - trying to enable the multiline message configuration. We have stacktrace on our nodeJs side, but unable to see or figure out how to have a multi line trace in graylog

2. Any tips much appreciated 🙂

---

<div class="post-metadata">

**Author:** ![gsmith](https://sea2.discourse-cdn.com/flex016/user_avatar/community.graylog.org/gsmith/32/1222_2.png) [@gsmith](https://community.graylog.org/u/gsmith)\
**Post date:** [June 23, 2023, 4:55am UTC](https://community.graylog.org/t/how-to-view-stacktrace-in-graylog/29228/2 "2023-06-23T04:55:34Z")

</div>

Hey @MacKnight

This document may help.

- [Manual Setup](https://go2docs.graylog.org/5-0/downloading_and_installing_graylog/manual_installation_on_linux.html)

---

<div class="post-metadata">

**Author:** ![drewmiranda-gl](https://sea2.discourse-cdn.com/flex016/user_avatar/community.graylog.org/drewmiranda-gl/32/13376_2.png) [@drewmiranda-gl](https://community.graylog.org/u/drewmiranda-gl)\
**Post date:** [June 23, 2023, 7:32pm UTC](https://community.graylog.org/t/how-to-view-stacktrace-in-graylog/29228/3 "2023-06-23T19:32:26Z")

</div>

How are you sending in logs to graylog? Its important that it can support multi line. For example, when using [filebeat](https://www.elastic.co/beats/filebeat), you can configure multiline support so the trace is sent as a single message.

There isn’t really a way to recombine the messages in graylog if they are sent 1 message per line so this part is very important.

---

<div class="post-metadata">

**Author:** ![MacKnight](https://sea2.discourse-cdn.com/flex016/user_avatar/community.graylog.org/macknight/32/14974_2.png) [@MacKnight](https://community.graylog.org/u/MacKnight)\
**Post date:** [June 28, 2023, 9:00am UTC](https://community.graylog.org/t/how-to-view-stacktrace-in-graylog/29228/4 "2023-06-28T09:00:06Z")

</div>

We are using Gelf transport from our Nodejs application.

```auto
interface LogMessage extends winston.Logform.TransformableInfo {
  timestamp?: string;
  level: string;
  message: string;
  stack?: string;
}

const gelfTransport = new GelfTransport(options);

export const logger = winston.createLogger({
  level: process.env.LOG_LEVEL || 'info',
  format: winston.format.combine(
    winston.format.colorize(),
    winston.format.errors({ stack: true }),
    winston.format.timestamp({ format: 'YYYY-MM-DD HH:mm:ss.SSS' }),
    winston.format.printf((info: LogMessage) => {
      const logText = `[${process.env.NODE_ENV}] ${info.timestamp} [${info.level}]: ${info.message}`;
      return info.stack ? `${logText}\n${info.stack}` : logText;
    }),
  ),
  transports: [
    new winston.transports.Console(),
    gelfTransport
  ],
});

if (process.env.NODE_ENV === PROD_ENV) {
  logger.remove(winston.transports.Console);
}

We have graylog running in a kubernetes cluster. The trace prints fine to the console, but we are unable to get it in graylog.

```

---

<div class="post-metadata">

**Author:** ![drewmiranda-gl](https://sea2.discourse-cdn.com/flex016/user_avatar/community.graylog.org/drewmiranda-gl/32/13376_2.png) [@drewmiranda-gl](https://community.graylog.org/u/drewmiranda-gl)\
**Post date:** [June 28, 2023, 1:43pm UTC](https://community.graylog.org/t/how-to-view-stacktrace-in-graylog/29228/5 "2023-06-28T13:43:13Z")

</div>

I unfortunately don’t have any direct experience with nodejs, but what i was able to find is that when writing the messages to the logger (or console) to output them as multiline messages. An example here: [javascript - Indented, multi-line logging in NodeJS - Stack Overflow](https://stackoverflow.com/questions/32540948/indented-multi-line-logging-in-nodejs) .

I understand this isn’t a “plug and play” fix but may be the only way to address.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex016/uploads/graylog/original/3X/c/7/c7c09c6b5099570133d6502b83f50ba4430de5b6.png) [@system](https://community.graylog.org/u/system)\
**Post date:** [July 12, 2023, 1:43pm UTC](https://community.graylog.org/t/how-to-view-stacktrace-in-graylog/29228/6 "2023-07-12T13:43:59Z")

</div>

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.
