Built motion from commit 9d1906d1.|2.5.40
[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 _0xa6eb=['YYYY-MM-DD\x20HH:mm:ss','toUpperCase','exports','Logger','transports','File','error','%s-%s','info','Console','debugLevel','moment','winston','util','INFO','join','/var','log','message','replace','{{{','}}}','format','[%s]\x20[%s]\x20%s\x20-\x20%s'];(function(_0x413729,_0x58d905){var _0x105135=function(_0x6dd55f){while(--_0x6dd55f){_0x413729['push'](_0x413729['shift']());}};_0x105135(++_0x58d905);}(_0xa6eb,0x15b));var _0xba6e=function(_0x3fe417,_0x5b0e98){_0x3fe417=_0x3fe417-0x0;var _0x1f8583=_0xa6eb[_0x3fe417];return _0x1f8583;};'use strict';var moment=require(_0xba6e('0x0'));var winston=require(_0xba6e('0x1'));var util=require(_0xba6e('0x2'));var path=require('path');var debugLevel=_0xba6e('0x3');function filename(_0x4b77eb,_0x28a516){return path[_0xba6e('0x4')](_0xba6e('0x5'),_0xba6e('0x6'),'xcally',util['format']('%s-%s.log',_0x4b77eb,_0x28a516));}function formatter(_0x4b108a,_0x5242b3){_0x5242b3[_0xba6e('0x7')]=_0x5242b3[_0xba6e('0x7')][_0xba6e('0x8')](/@@{/g,_0xba6e('0x9'))[_0xba6e('0x8')](/}@@/g,_0xba6e('0xa'))[_0xba6e('0x8')](/@{/g,'{{')[_0xba6e('0x8')](/}@/g,'}}');return util[_0xba6e('0xb')](_0xba6e('0xc'),moment()[_0xba6e('0xb')](_0xba6e('0xd')),_0x5242b3['level'][_0xba6e('0xe')](),_0x4b108a,_0x5242b3[_0xba6e('0x7')]);}module[_0xba6e('0xf')]=function(_0xa57b83){return new winston[(_0xba6e('0x10'))]({'transports':[new winston[(_0xba6e('0x11'))][(_0xba6e('0x12'))]({'name':util[_0xba6e('0xb')]('%s-%s',_0xa57b83,_0xba6e('0x13')),'filename':filename(_0xa57b83,_0xba6e('0x13')),'level':'error','json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x2720b7){return formatter(_0xa57b83,_0x2720b7);}}),new winston['transports']['File']({'name':util[_0xba6e('0xb')](_0xba6e('0x14'),_0xa57b83,'info'),'filename':filename(_0xa57b83,_0xba6e('0x15')),'level':_0xba6e('0x15'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x32fc1f){return formatter(_0xa57b83,_0x32fc1f);}}),new winston[(_0xba6e('0x11'))][(_0xba6e('0x16'))]({'level':process['env'][_0xba6e('0x17')]||debugLevel,'json':![],'formatter':function(_0x1b856e){return formatter(_0xa57b83,_0x1b856e);}})]});};