Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[New Platform / LoggerFactory] Debug messages are not appearing #55456

Closed
tsullivan opened this issue Jan 21, 2020 · 12 comments · Fixed by #55752
Closed

[New Platform / LoggerFactory] Debug messages are not appearing #55456

tsullivan opened this issue Jan 21, 2020 · 12 comments · Fixed by #55752
Assignees
Labels
bug Fixes for quality problems that affect the customer experience Feature:New Platform Team:Core Core services & architecture: plugins, logging, config, saved objects, http, ES client, i18n, etc

Comments

@tsullivan
Copy link
Member

In #55442 Reporting Services team is re-instrumenting the plugin to use the new logging service from the New Platform.

In that test branch, I see almost all of the log messages that can be seen in master, except for debug-level messages.

CSV export has a few debug messages. In master, a CSV export job could log this:

server    log   [11:43:32.340] [debug][esqueue][queue-worker][reporting] k5o88fof21n67a3f11cncpbn - Job created in index .reporting-2020.01.19
server    log   [11:43:32.363] [debug][esqueue][queue-worker][reporting] k5o88fof21n67a3f11cncpbn - Job index refreshed .reporting-2020.01.19
server    log   [11:43:32.364] [info][queue-job][reporting] Successfully queued job: k5o88fof21n67a3f11cncpbn
server    log   [11:43:34.475] [debug][esqueue][queue-worker][reporting] k5o7yx7y21n67a3f11ebtyjb - 1 outstanding jobs returned
server    log   [11:43:34.494] [info][esqueue][queue-worker][reporting] k5o7yx7y21n67a3f11ebtyjb - Job marked as claimed: /.reporting-2020.01.19/k5o88fof21n67a3f11cncpbn
server    log   [11:43:34.494] [info][esqueue][queue-worker][reporting] k5o7yx7y21n67a3f11ebtyjb - Starting job
server    log   [11:43:34.558] [warning][csv][execute-job][k5o88fof21n67a3f11cncpbn][reporting] Kibana Advanced Setting "dateFormat:tz" is set to "Browser". Dates will be formatted as UTC to avoid ambiguity.
server    log   [11:43:34.559] [debug][csv][execute-job][k5o88fof21n67a3f11cncpbn][reporting] executing search request
server    log   [11:43:34.706] [debug][csv][execute-job][k5o88fof21n67a3f11cncpbn][reporting] executing scroll request
server    log   [11:43:34.858] [debug][csv][execute-job][k5o88fof21n67a3f11cncpbn][reporting] executing scroll request
server    log   [11:43:34.995] [debug][csv][execute-job][k5o88fof21n67a3f11cncpbn][reporting] executing scroll request
server    log   [11:43:35.160] [debug][csv][execute-job][k5o88fof21n67a3f11cncpbn][reporting] executing scroll request
server    log   [11:43:35.417] [debug][csv][execute-job][k5o88fof21n67a3f11cncpbn][reporting] executing scroll request
server    log   [11:43:35.586] [debug][csv][execute-job][k5o88fof21n67a3f11cncpbn][reporting] executing scroll request
server    log   [11:43:35.601] [debug][csv][execute-job][k5o88fof21n67a3f11cncpbn][reporting] executing clearScroll request
server    log   [11:43:35.616] [debug][csv][execute-job][k5o88fof21n67a3f11cncpbn][reporting] finished generating, total size in bytes: 446137
server    log   [11:43:35.618] [info][esqueue][queue-worker][reporting] k5o7yx7y21n67a3f11ebtyjb - Job execution completed successfully
server    log   [11:43:35.794] [debug][queue-worker][reporting] Worker completed: (k5o88fof21n67a3f11cncpbn)
server    log   [11:43:35.794] [info][esqueue][queue-worker][reporting] k5o7yx7y21n67a3f11ebtyjb - Job data saved successfully: /.reporting-2020.01.19/k5o88fof21n67a3f11cncpbn

In the New Platform logger, only the info log messages appear:

server    log   [11:33:40.589] [info][queue-job][reporting] Successfully queued job: k5o7vqy7219v7a3f11crntxa
server    log   [11:33:41.693] [info][info][esqueue][queue-worker][reporting] k5o7qvh2219v7a3f115wezue - Job marked as claimed: /.reporting-2020.01.19/k5o7vqy7219v7a3f11crntxa
server    log   [11:33:41.695] [info][info][esqueue][queue-worker][reporting] k5o7qvh2219v7a3f115wezue - Starting job
server    log   [11:33:41.760] [warning][csv][execute-job][k5o7vqy7219v7a3f11crntxa][reporting] Kibana Advanced Setting "dateFormat:tz" is set to "Browser". Dates will be formatted as UTC to avoid ambiguity.
server    log   [11:33:42.774] [info][info][esqueue][queue-worker][reporting] k5o7qvh2219v7a3f115wezue - Job execution completed successfully
server    log   [11:33:42.976] [info][info][esqueue][queue-worker][reporting] k5o7qvh2219v7a3f115wezue - Job data saved successfully: /.reporting-2020.01.19/k5o7vqy7219v7a3f11crntxa
@tsullivan
Copy link
Member Author

Reproducing the issue with a simpler test.

This should enable debug logging for Reporting in kibana.yml:
logging.events.log: ['warning', 'error', 'fatal', 'info', 'reporting']

Add a debug log and info in reporting/server/plugin.ts

  return new (class ReportingPlugin implements ReportingPlugin {
    private initializerContext: ReportingInitializerContext;

    constructor(context: ReportingInitializerContext) {
      this.initializerContext = context;
      const simpleLog = this.initializerContext.logger.get('reporting');
      simpleLog.debug('this is a reporting debug log');
      simpleLog.info('this is a reporting info log');
    }

Only info line is logged:
image

@joshdover joshdover added the Team:Core Core services & architecture: plugins, logging, config, saved objects, http, ES client, i18n, etc label Jan 21, 2020
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-platform (Team:Platform)

@joshdover joshdover added the bug Fixes for quality problems that affect the customer experience label Jan 21, 2020
@joshdover joshdover self-assigned this Jan 21, 2020
@tsullivan
Copy link
Member Author

Hi, just want to call out that this is blocking https://github.com/elastic/kibana/pull/55442

@joshdover
Copy link
Contributor

@tsullivan In your example you don't have debug in the logging config. Am I right in saying that in the legacy platform, if you configure a specific tag (eg. reporting), then all logs with that tag get logged, regardless of level?

@tsullivan
Copy link
Member Author

tsullivan commented Jan 22, 2020

@tsullivan In your example you don't have debug in the logging config. Am I right in saying that in the legacy platform, if you configure a specific tag (eg. reporting), then all logs with that tag get logged, regardless of level?

That is correct. If my logging configuration in kibana.yml looks like:

logging.events.log: ['warning', 'error', 'fatal', 'info', 'reporting']

Any log line with the reporting tag should get printed.

This is a good alternative to enabling full verbose logging for all parts of Kibana, when all I care about is verbose logging for Reporting.

@tsullivan
Copy link
Member Author

Since the workaround for this issue is just to enable plain verbose logging, I'll take off the blocker label. But I think it's important to have some way of whitelisting logging tags so they'd be logged even if they are low-level.

@tsullivan tsullivan removed the blocker label Jan 22, 2020
@pgayvallet
Copy link
Contributor

logging.events.log: ['warning', 'error', 'fatal', 'info', 'reporting']

this.initializerContext.logger.get('reporting');

This actually creates a plugins.reporting logger context

@joshdover I don't know very well our implementation, but we follow more or less log4j api, isn't the solution just to declare a specific logger for plugins.reporting in the configuration file (and associated appender) and set the it's logLevel to 'all'/debug' ?

@mshustov
Copy link
Contributor

mshustov commented Jan 23, 2020

but we follow more or less log4j api,

We will follow when #41956 lands.

@joshdover
Copy link
Contributor

Since the workaround for this issue is just to enable plain verbose logging, I'll take off the blocker label. But I think it's important to have some way of whitelisting logging tags so they'd be logged even if they are low-level.

Once #41956 is done and we enable the new logging configuration, this will be possible. However, I also think it's important that logging configurations don't break during 7.x, so if this logging config worked before migrating to the New Platform, then it needs to be fixed as well.

I'm working on this today and should have a fix up soon.

@tsullivan
Copy link
Member Author

Hi, this issue has re-appeared in the past couple of weeks.

My logging config:

logging.events.log: ['warning', 'error', 'fatal', 'info', 'reporting']

"Debug" level Reporting logs are not showing up.

@tsullivan tsullivan reopened this Feb 18, 2020
@joshdover
Copy link
Contributor

@restrry I know the receiveAllLevels option was removed, did we break this?

@mshustov
Copy link
Contributor

@tsullivan my bad, I forgot to warn you that NP logging config is available and I removed receiveAllLevels flag since it's incompatible with the LP logging system.
you could enable logging for all reporting messages via NP logging config

logging:
  loggers:
      - context: reporting
        appenders: [console]
        level: debug

More about NP logging config https://github.com/elastic/kibana/blob/master/src/core/server/logging/README.md
Let me know if the proposed setup works for you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Fixes for quality problems that affect the customer experience Feature:New Platform Team:Core Core services & architecture: plugins, logging, config, saved objects, http, ES client, i18n, etc
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants