You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jan 3, 2022. It is now read-only.
I have a weird problem where only the first log is saved to the database. Afterwards no logs are saved.
After 16 logs also my other transport (Console) does not work anymore.
When I try to query it I always get no results (See console output below). The first log is saved so the database does exist and maybe work? I can query the table from psql and there I see more than 10 records.
{ undefined: [ count: 0, command: 'SELECT' ] }
I am glad to deliver more information. I have seen that it should have been fixed in #27
I would also enjoy the typescript pr. It would be great if you could join it.
The text was updated successfully, but these errors were encountered:
@panwauu Yes, I can confirm this behaviour Unfortunately for this time it's more likely issue on a winston level I've found similar issue winstonjs/winston#1757 Unfortunately, this problem can only be solved by re-instantiation.
Here is a working solution for express integration (in conjunction with morgan)
const winston = require('winston');
const PostgresTransport = require('winston-postgres-transport');
const options = {
level: 'info',
name: 'Postgres',
postgresOptions: {
debug: console.log,
},
postgresUrl: 'postgres://winston:[email protected]:5432/winston',
tableName: 'winston_logs',
};
const logger = () => winston.createLogger({
level: 'info',
format: winston.format.json(),
transports: [new PostgresTransport(options)],
});
// create a stream object with a 'write' function that will be used by `morgan`
logger.stream = {
write(message, _encoding) {
logger().info(message);
},
};
module.exports = logger;
logger().info(message); will resolve issue in this case
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
I have a weird problem where only the first log is saved to the database. Afterwards no logs are saved.
After 16 logs also my other transport (Console) does not work anymore.
When I try to query it I always get no results (See console output below). The first log is saved so the database does exist and maybe work? I can query the table from psql and there I see more than 10 records.
I am glad to deliver more information. I have seen that it should have been fixed in #27
I would also enjoy the typescript pr. It would be great if you could join it.
The text was updated successfully, but these errors were encountered: