Newlines are stripped from log messages

Newline characters are stripped from logs api requests. Basically I am looking to have stack traces readable.

ERROR testing:135 Exception outer
Traceback (most recent call last):
  File "/home/james/finetune/am-logging-setup/tests/test_amlogging.py" line 131 in test_python_nested_exception
    raise Exception("Exception inner")
Exception: Exception inner

Is improperly rendered like so:

ERROR testing:135 Exception outer Traceback (most recent call last): File "/home/james/finetune am-logging-setup/tests/test_amlogging.py" line 131 in test_python_nested_exception raise Exception("Exception inner") Exception: Exception inner

Using the https://github.com/newrelic/aws-log-ingestion lambda function.
Slightly modified to batch log statements together.

It appears that the newlines are not stripped. They are passed through, however they aren’t handled by your application code to be visible. This can be very easily fixed by setting a single css property:

.nr1-logger .new-log-table-component .log-message {
...
  white-space: pre-wrap;
}

The selector is already used in your stylesheets. You just need to define the white-space property additionally.

1 Like

Hi, @james92: While you wait for New Relic to implement your suggestion, you may use a browser extension, such as Stylish, to override the CSS in your browser.