File tree 2 files changed +4
-2
lines changed
2 files changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -3,6 +3,7 @@ let loggingEnv: LoggingEnvironment | undefined = undefined;
3
3
export type LoggingEnvironment = {
4
4
logLevel : string ;
5
5
logDir ?: string ;
6
+ network ?: string ;
6
7
} ;
7
8
8
9
export const getEnvironment = ( ) => {
@@ -12,6 +13,7 @@ export const getEnvironment = () => {
12
13
loggingEnv = {
13
14
logLevel : process . env . LOG_LEVEL || 'info' ,
14
15
logDir : process . env . LOG_DIR ,
16
+ network : process . env . NETWORK ,
15
17
} ;
16
18
return loggingEnv ;
17
19
}
Original file line number Diff line number Diff line change @@ -45,7 +45,7 @@ export const getLogger = (source: string): WormholeLogger => {
45
45
} ;
46
46
47
47
const createBaseLogger = ( ) : WormholeLogger => {
48
- const { logLevel, logDir } = getEnvironment ( ) ;
48
+ const { logLevel, logDir, network } = getEnvironment ( ) ;
49
49
const logPath = ! ! logDir ? `${ logDir } /watcher.${ new Date ( ) . toISOString ( ) } .log` : null ;
50
50
let transport : winston . transport [ ] = [
51
51
logPath
@@ -60,7 +60,7 @@ const createBaseLogger = (): WormholeLogger => {
60
60
const GRAFANA_HOST = assertEnvironmentVariable ( 'GRAFANA_HOST' ) ;
61
61
const GRAFANA_USERID = assertEnvironmentVariable ( 'GRAFANA_USERID' ) ;
62
62
const GRAFANA_PASSWORD = assertEnvironmentVariable ( 'GRAFANA_PASSWORD' ) ;
63
- const MY_APP_NAME = ' wormhole-dashboard';
63
+ const MY_APP_NAME = network === '' ? ' wormhole-dashboard' : `wormhole-dashboard- ${ network } ` ;
64
64
const GRAFANA_BASICAUTH = GRAFANA_USERID + ':' + GRAFANA_PASSWORD ;
65
65
transport . push (
66
66
new LokiTransport ( {
You can’t perform that action at this time.
0 commit comments