512374156794dc061ee5cdb6a6e8c9f382653566
[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 _0xd156=['}}}','[%s]\x20[%s]\x20%s\x20-\x20%s','YYYY-MM-DD\x20HH:mm:ss','toUpperCase','exports','transports','File','%s-%s','error','info','Console','env','debugLevel','moment','winston','util','path','INFO','join','/var','log','format','message','{{{','replace'];(function(_0x581960,_0x1232ff){var _0x4ee892=function(_0x2a920d){while(--_0x2a920d){_0x581960['push'](_0x581960['shift']());}};_0x4ee892(++_0x1232ff);}(_0xd156,0x1b6));var _0x6d15=function(_0x3a9e37,_0x402a0e){_0x3a9e37=_0x3a9e37-0x0;var _0x3b823c=_0xd156[_0x3a9e37];return _0x3b823c;};'use strict';var moment=require(_0x6d15('0x0'));var winston=require(_0x6d15('0x1'));var util=require(_0x6d15('0x2'));var path=require(_0x6d15('0x3'));var debugLevel=_0x6d15('0x4');function filename(_0x47bb67,_0x53f6f4){return path[_0x6d15('0x5')](_0x6d15('0x6'),_0x6d15('0x7'),'xcally',util[_0x6d15('0x8')]('%s-%s.log',_0x47bb67,_0x53f6f4));}function formatter(_0x100489,_0x5c8e1e){_0x5c8e1e[_0x6d15('0x9')]=_0x5c8e1e[_0x6d15('0x9')]['replace'](/@@{/g,_0x6d15('0xa'))[_0x6d15('0xb')](/}@@/g,_0x6d15('0xc'))[_0x6d15('0xb')](/@{/g,'{{')[_0x6d15('0xb')](/}@/g,'}}');return util[_0x6d15('0x8')](_0x6d15('0xd'),moment()[_0x6d15('0x8')](_0x6d15('0xe')),_0x5c8e1e['level'][_0x6d15('0xf')](),_0x100489,_0x5c8e1e[_0x6d15('0x9')]);}module[_0x6d15('0x10')]=function(_0x310e5d){return new winston['Logger']({'transports':[new winston[(_0x6d15('0x11'))][(_0x6d15('0x12'))]({'name':util[_0x6d15('0x8')](_0x6d15('0x13'),_0x310e5d,'error'),'filename':filename(_0x310e5d,_0x6d15('0x14')),'level':'error','json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x363e58){return formatter(_0x310e5d,_0x363e58);}}),new winston[(_0x6d15('0x11'))]['File']({'name':util['format']('%s-%s',_0x310e5d,_0x6d15('0x15')),'filename':filename(_0x310e5d,_0x6d15('0x15')),'level':'info','json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x10bd2b){return formatter(_0x310e5d,_0x10bd2b);}}),new winston[(_0x6d15('0x11'))][(_0x6d15('0x16'))]({'level':process[_0x6d15('0x17')][_0x6d15('0x18')]||debugLevel,'json':![],'formatter':function(_0x44e922){return formatter(_0x310e5d,_0x44e922);}})]});};