question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

logging transports doesn't convert configuration input to an array

See original GitHub issue

Issue Summary

https://github.com/TryGhost/Ghost/blob/master/core/server/config/env/config.production.json#L22 If I specify a single logging transport, this throws an error,

        this.transports.forEach((transport) => {
                        ^

TypeError: this.transports.forEach is not a function
    at new GhostLogger (/home/esatterwhite/dev/js/ghost-blog/versions/1.7.1/node_modules/ghost-ignition/lib/logging/GhostLogger.js:54:25)
    at createNewInstance (/home/esatterwhite/dev/js/ghost-blog/versions/1.7.1/node_modules/ghost-ignition/lib/logging/index.js:10:19)
    at Object.<anonymous> (/home/esatterwhite/dev/js/ghost-blog/versions/1.7.1/core/server/logging.js:4:18)
    at Module._compile (module.js:570:32)
    at Object.Module._extensions..js (module.js:579:10)
    at Module.load (module.js:487:32)
    at tryModuleLoad (module.js:446:12)
    at Function.Module._load (module.js:438:3)
    at Module.require (module.js:497:17)
    at require (internal/module.js:20:19)
    at Object.<anonymous> (/home/esatterwhite/dev/js/ghost-blog/versions/1.7.1/core/server/index.js:20:15)
    at Module._compile (module.js:570:32)
    at Object.Module._extensions..js (module.js:579:10)
    at Module.load (module.js:487:32)
    at tryModuleLoad (module.js:446:12)
    at Function.Module._load (module.js:438:3)

A summary of the issue and the browser/OS environment in which it occurs.

Steps to Reproduce

node current/index.js --logging:level=error --logging:transports=file

Any other info e.g. Why do you consider this to be a bug? What did you expect to happen instead?

Technical details:

  • Ghost Version: 1.7
  • Node Version: 6.11
  • Browser/OS: N/A
  • Database: N/A

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:14 (7 by maintainers)

github_iconTop GitHub Comments

2reactions
kirrg001commented, Sep 4, 2018

@BretFisher nconf has merged the support for array parsing.

    nconf.env({
        separator: '__',
        parseValues: true
    });

We have to add a flag to tell nconf to parse arrays/objects using parseValues.

I’ll re-open this issue now. PR is welcome 👍

0reactions
kirrg001commented, Oct 3, 2018

logging__transports=‘[“stdout”]’ node index.js

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to log JavaScript objects and arrays in winston as ...
Use the built-in Node.js function util.format to convert your objects to strings in the same way that console.log does.
Read more >
Complete Winston Logger Guide With Hands-on Examples
Winston creates custom logger instances which can be configured to ... To define them, you can add a transports array (which can contain...
Read more >
Extract array | Filebeat Reference [8.5] - Elastic
The following example will populate source.ip with the first element of the my_array field, destination.ip with the second element, and network.transport with ...
Read more >
Log4j 2 Layouts - Apache Logging Services
In Log4j 2 Layouts return a byte array. This allows the result of the Layout to be useful in many more types of...
Read more >
Logging - Zephyr Project Documentation
It cannot be used to lower module logging levels that were ... to the transport are not performed by default when logging API...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found