i have initialized the logger like in the docs: https://atmospherejs.com/ostrio/logger with a transport to mongodb: https://atmospherejs.com/ostrio/loggermongo#initialization-isomorphic
import { Logger } from 'meteor/ostrio:logger';
import { LoggerMongo } from 'meteor/ostrio:loggermongo';
export const idLogger = new IdLogger();
export function addMongoDbLogging(idLogger, filters) {
(new LoggerMongo(idLogger , {
collection: AppLogs,
})).enable({
enable: true,
filter: filters,
client: true,
server: true,
});
}
The code lies is in the imports directory And the call to is in the server directory during meteor startup.
if(Meteor.isServer) {
initLogger(); // calls addMongoDbLogging();
}
On The server logging works with no problems. All logs are written in the AppLogs Collection. But when i try to log something from the client... nothing happens.
Same behavior is for other transports like console. See: https://atmospherejs.com/ostrio/loggerconsole
Serverside all logs show up in my console. Client logs are not shown on neither server or client consoles.
Can someone tell me what's wrong here?
Update: It could be that the server/startup
is not the right place for isomorphic code. Where should this be put?