d366c32d41b8bdb9a26109a883e26b1bf217543c
[motion2.git] / server / config / logger.js
1 // *************************************************************************
2 // *                                                                       *
3 // * xCALLY Motion -  The Omnichannel Contact Center                       *
4 // * Copyright (c) Xenialab s.r.l. All Rights Reserved                     *
5 // *                                                                       *
6 // *************************************************************************
7 // *                                                                       *
8 // * Email: info@xcally.com                                                *
9 // * Website: https://www.xcally.com                                       *
10 // *                                                                       *
11 // *************************************************************************
12 // *                                                                       *
13 // * The SOFTWARE PRODUCT is protected by copyright laws and international *
14 // * copyright treaties, as well as other intellectual property laws and   *
15 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                         *
16 // *                                                                       *
17 // *************************************************************************
18 var _0xfe32=['INFO','log','xcally','format','%s-%s.log','[%s]\x20[%s]\x20%s\x20-\x20%s','YYYY-MM-DD\x20HH:mm:ss','level','toUpperCase','message','exports','transports','File','%s-%s','error','info','Console','env','debugLevel','util','path'];(function(_0x35b99b,_0x2efd45){var _0xc34057=function(_0x59ffe9){while(--_0x59ffe9){_0x35b99b['push'](_0x35b99b['shift']());}};_0xc34057(++_0x2efd45);}(_0xfe32,0x1e1));var _0x2fe3=function(_0x2f53d6,_0x5e50ab){_0x2f53d6=_0x2f53d6-0x0;var _0x4d4e74=_0xfe32[_0x2f53d6];return _0x4d4e74;};'use strict';var moment=require('moment');var winston=require('winston');var util=require(_0x2fe3('0x0'));var path=require(_0x2fe3('0x1'));var debugLevel=_0x2fe3('0x2');function filename(_0x2912be,_0x1cdd6a){return path['join']('/var',_0x2fe3('0x3'),_0x2fe3('0x4'),util[_0x2fe3('0x5')](_0x2fe3('0x6'),_0x2912be,_0x1cdd6a));}function formatter(_0x6fe26b,_0x5efcc5){return util[_0x2fe3('0x5')](_0x2fe3('0x7'),moment()[_0x2fe3('0x5')](_0x2fe3('0x8')),_0x5efcc5[_0x2fe3('0x9')][_0x2fe3('0xa')](),_0x6fe26b,_0x5efcc5[_0x2fe3('0xb')]);}module[_0x2fe3('0xc')]=function(_0x401cd3){return new winston['Logger']({'transports':[new winston[(_0x2fe3('0xd'))][(_0x2fe3('0xe'))]({'name':util['format'](_0x2fe3('0xf'),_0x401cd3,_0x2fe3('0x10')),'filename':filename(_0x401cd3,'error'),'level':_0x2fe3('0x10'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x5fc935){return formatter(_0x401cd3,_0x5fc935);}}),new winston[(_0x2fe3('0xd'))][(_0x2fe3('0xe'))]({'name':util[_0x2fe3('0x5')](_0x2fe3('0xf'),_0x401cd3,_0x2fe3('0x11')),'filename':filename(_0x401cd3,'info'),'level':_0x2fe3('0x11'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x1beaa5){return formatter(_0x401cd3,_0x1beaa5);}}),new winston[(_0x2fe3('0xd'))][(_0x2fe3('0x12'))]({'level':process[_0x2fe3('0x13')][_0x2fe3('0x14')]||debugLevel,'json':![],'formatter':function(_0x26f97d){return formatter(_0x401cd3,_0x26f97d);}})]});};