<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[How to configure logging output in json format?]]></title><description><![CDATA[<p>Hello Guys,</p>
<p>Please help us understand how to configure log output in json format or how to integrate JSreport logs with Kibana?</p>
]]></description><link>https://forum.jsreport.net/topic/3041/how-to-configure-logging-output-in-json-format</link><generator>RSS for Node</generator><lastBuildDate>Wed, 12 Aug 2026 08:59:28 GMT</lastBuildDate><atom:link href="https://forum.jsreport.net/topic/3041.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 08 Jan 2024 13:47:30 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to How to configure logging output in json format? on Invalid Date]]></title><description><![CDATA[<p>Hello Guys,</p>
<p>Please help us understand how to configure log output in json format or how to integrate JSreport logs with Kibana?</p>
]]></description><link>https://forum.jsreport.net/post/13046</link><guid isPermaLink="true">https://forum.jsreport.net/post/13046</guid><dc:creator><![CDATA[acx-dartemiev]]></dc:creator><pubDate>Invalid Date</pubDate></item><item><title><![CDATA[Reply to How to configure logging output in json format? on Invalid Date]]></title><description><![CDATA[<p>jsreport uses the <a href="https://github.com/winstonjs/winston" rel="nofollow">winston</a> logging package so pretty much everything you find out in the winston docs can be applied in the jsreport.<br />
<a href="https://jsreport.net/learn/configuration#logging" rel="nofollow">https://jsreport.net/learn/configuration#logging</a></p>
<p>To enable json for all <code>transports</code>, add a default logging config to <code>jsreport.config.json</code>.</p>
<pre><code class="language-js"> &quot;logger&quot;: {
    &quot;console&quot;: {
      &quot;transport&quot;: &quot;console&quot;,
      &quot;level&quot;: &quot;debug&quot;
    },
    &quot;file&quot;: {
      &quot;transport&quot;: &quot;file&quot;,
      &quot;level&quot;: &quot;debug&quot;,
      &quot;filename&quot;: &quot;logs/log.txt&quot;
    },
    &quot;error&quot;: {
      &quot;transport&quot;: &quot;file&quot;,
      &quot;level&quot;: &quot;error&quot;,
      &quot;filename&quot;: &quot;logs/error.txt&quot;
    }
  },
</code></pre>
<p>And the update the app <code>server.js</code> file with the following. It will instruct all transports to format in json.</p>
<pre><code class="language-js">const jsreport = require('jsreport')()

if (process.env.JSREPORT_CLI) {
  // export jsreport instance to make it possible to use jsreport-cli
  module.exports = jsreport
} else {
  jsreport.afterConfigLoaded(() =&gt; {
    const winston = require('winston')
    jsreport.logger.format = require('winston').format.combine(
      jsreport.logger.format,
      winston.format.json()
    )
  })
  jsreport.init().then(() =&gt; {
    // running
  }).catch((e) =&gt; {
    // error during startup
    console.error(e.stack)
    process.exit(1)
  })
}

</code></pre>
]]></description><link>https://forum.jsreport.net/post/13054</link><guid isPermaLink="true">https://forum.jsreport.net/post/13054</guid><dc:creator><![CDATA[admin]]></dc:creator><pubDate>Invalid Date</pubDate></item></channel></rss>