Skip to content

Commit

Permalink
[FIX] syslog logic
Browse files Browse the repository at this point in the history
  • Loading branch information
XK4MiLX committed Jan 30, 2025
1 parent 2264d8d commit d010223
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions ZelBack/src/services/dockerService.js
Original file line number Diff line number Diff line change
Expand Up @@ -648,14 +648,23 @@ async function appDockerCreate(appSpecifications, appName, isComponent, fullAppS
}
});

const isRemoteLog = envParams?.some((env) => env.startsWith('LOG=SYSLOG'));
const logConfig = isRemoteLog
// Identify apps with LOG=SEND
const isRemoteLog = envParams?.some((env) => env.startsWith('LOG=SEND'));
// Find target app with LOG=COLLECT
let syslogTarget = null;
if (fullAppSpecs && fullAppSpecs.compose) {
syslogTarget = fullAppSpecs.compose.find((app) => app.environmentParameters?.some((env) => env.startsWith('LOG=COLLECT')))?.name;
}

log.info(`isRemoteLog=${isRemoteLog}, syslogTarget=${syslogTarget}`);

const logConfig = isRemoteLog && syslogTarget
? {
Type: 'syslog',
Config: {
'syslog-address': `udp://${appSpecifications.name}:514`,
'syslog-address': `udp://${syslogTarget}:514`,
'syslog-facility': 'local0',
tag: identifier,
tag: `${appSpecifications.name}`,
},
}
: {
Expand Down

0 comments on commit d010223

Please sign in to comment.