mirror of
https://git.joinsharkey.org/Sharkey/Sharkey.git
synced 2024-11-10 18:53:09 +02:00
18 lines
357 B
TypeScript
18 lines
357 B
TypeScript
|
import * as mongo from 'mongodb';
|
||
|
import db from '../db/mongodb';
|
||
|
|
||
|
const Log = db.get<ILog>('logs');
|
||
|
Log.createIndex('createdAt', { expireAfterSeconds: 3600 * 24 * 3 });
|
||
|
export default Log;
|
||
|
|
||
|
export interface ILog {
|
||
|
_id: mongo.ObjectID;
|
||
|
createdAt: Date;
|
||
|
machine: string;
|
||
|
worker: string;
|
||
|
domain: string[];
|
||
|
level: string;
|
||
|
message: string;
|
||
|
data: any;
|
||
|
}
|