godong9 / solr-node

Simple Solr Node Client Project.
MIT License
25 stars 25 forks source link

Can't get logging to work #82

Closed kriston13 closed 5 years ago

kriston13 commented 5 years ago

Based on this: http://godong9.github.io/solr-node/docs/Client.html

We are creating a new client in this manner:

const client = new SolrNode({
    host: process.env.SOLR_SERVICE_SERVICE_HOST,
    port: process.env.SOLR_SERVICE_SERVICE_PORT,
    core: config.solr.core,
    protocol: process.env.SOLR_SERVICE_SERVICE_PROTOCOL,
    rootPath: process.env.SOLR_SERVICE_SERVICE_ROOT_PATH,
    debugLevel: process.env.SOLR_LOG_LEVEL || /*'ALL' | 'DEBUG' | */ 'INFO' /* | 'ERROR'*/
  });

We're then setting our environment variable SOLR_LOG_LEVEL to DEBUG, but we're not seeing any logging. We've also hardcoding with ALL, and also not getting any logging.

Any suggestions on what we're doing wrong?

Thank you

godong9 commented 5 years ago

Sorry to confusing.

You should use like this. (README.md)

// Require module
var SolrNode = require('solr-node');

// Create client
var client = new SolrNode({
    host: '127.0.0.1',
    port: '8983',
    core: 'test',
    protocol: 'http'
});

// Set logger level (can be set to DEBUG, INFO, WARN, ERROR, FATAL or OFF)
require('log4js').getLogger('solr-node').level = 'DEBUG';