How to debug implementation as module ? Log not showing in Elasticsearch
See original GitHub issueHi there,
I am trying top use this lib as a module but unfortunately logs are not showing in Elasticsearch and I don’t have anything displayed in my console related to this module.
Here is my code :
import * as pino from "pino";
import { multistream } from "pino-multi-stream";
const pinoElastic = require("pino-elasticsearch");
const streamToElastic = pinoElastic({
node: "http://elastic:PASSWORD@URL:9200",
});
var streams = [{ stream: process.stdout }, { stream: streamToElastic }];
export const logger = pino({ level: "debug" }, multistream(streams)).child({ infoAddedToAllLogs: "test" });
logger.debug("Hello world");
Logs are successfully displayed in console, but unfortunately nothing related to Elasticsearch errors and nothing in Elasticsearch.
How can I debug this?
Thanks for your help
Issue Analytics
- State:
- Created 3 years ago
- Reactions:4
- Comments:8 (1 by maintainers)
Top Results From Across the Web
No logs appearing in Kibana - Elasticsearch
I'd first off check if there's the data you expect in Elasticsearch by seeing what indices exist using the API: _cat/indices?v . If...
Read more >Logging | Elasticsearch Guide [8.5]
Each logger accepts Log4j 2's built-in log levels, from least to most verbose: OFF , FATAL , ERROR , WARN , INFO ,...
Read more >Elasticsearch Logging Secrets
Another trick that I found myself using several times to debug Groovy scripts in Elasticsearch is logging inside the script itself to double ......
Read more >Reporting troubleshooting | Kibana Guide [8.5]
When Kibana is running, navigate to the Report Listing page, and click Run ... traffic will be logged via the debug module under...
Read more >Enable audit logging | Elasticsearch Guide [8.5]
Audit logs are disabled by default. You must explicitly enable audit logging. Audit logs are only available on certain subscription levels. For more...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Hello! I’ve just run this code:
And everything works as expected.
pino-elasticsearch
sends the logs if eitherflush-bytes
is reached or ifflush-interval
has elapsed. Unless something kills the process beforeflush-interval
is triggered, the process will wait until all timers have been executed.Be aware that you will not see the logs immediately in Elasticsearch because of the refresh interval.
Hi @delvedor , It works! Thank you