Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/kolyasya/meteor-auto-logger
Auto logger for Meteor DDP events
https://github.com/kolyasya/meteor-auto-logger
logger logs meteor meteorjs
Last synced: about 1 month ago
JSON representation
Auto logger for Meteor DDP events
- Host: GitHub
- URL: https://github.com/kolyasya/meteor-auto-logger
- Owner: kolyasya
- Created: 2023-02-20T13:02:41.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2024-10-24T07:49:19.000Z (3 months ago)
- Last Synced: 2024-10-25T01:25:06.626Z (3 months ago)
- Topics: logger, logs, meteor, meteorjs
- Language: JavaScript
- Homepage: https://packosphere.com/kolyasya/auto-logger
- Size: 102 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# kolyasya:auto-logger — Log Meteor DDP events automatically
## Features:
- Print all DDP messages (except ping/pong and filtered by `ddpMessageFilter` to server console)
- Print all DDP messages into ddp-log.json file
- Print summary of called subsciptions and methods to server console by interval## Installation:
```
meteor add kolyasya:auto-logger
```## Package settings:
```js
{
// ...regular Meteor settings.json file...packages: {
// ...other packages settings...,
"kolyasya:auto-logger": {
// Logs for debugging purposes, not needed in normal circumstances
"enablePackageDebugLogs": false,// Main logging to be printed in console
"enableDDPAutoLogger": true,// Log all DDP events into file in root Meteor directory
"enableDDPFileLogger": false,
// In case if you need a non-standard path
"ddpFileLoggerPath": '../../../../..'// Calculates sum of sub and methods calls
"enableDDPTallyLogger": true,
// Interval for calculation
"DDPTallyLoggerSeconds": 60,// Cache is used only for current user now, time in ms
"customCacheTime": 300000
}
}
}
```## Usage example:
```js
import AutoLogger from "meteor/kolyasya:auto-logger";new AutoLogger({
// Doing it like this to preserve 'this'
eventsLogger: (message) => {
console.log("This is events log message:", message);
},
tallyLogger: (message) => {
console.log("This is tally log message:", message);
},ddpMessageFilter: ({ messageJSON }) => {
// Exclude loggly messages
return messageJSON?.method?.includes("loggly.") ? false : true;
},
});
```