Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix/config logs #739

Merged
merged 4 commits into from
Aug 22, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGES_NEXT_RELEASE
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
- Fix: smtp and smpp logs (#738)
- Add: allow access entities using NGSIv2 API for non_signal rules (new setting nonSignalByAPI / PERSEO_CHECK_NON_SIGNAL_BY_API) (#549)
- Remove support for ngsv1 notifications (#714)
- Remove ngsiv1 support for updateAction (#714)
Expand Down
12 changes: 9 additions & 3 deletions lib/models/emailAction.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,15 +70,20 @@ function SendMail(action, event, callback) {
transporterOptions = buildTransporterOptions(action, event),
opt2log,
smtpConfig,
transporter;
transporter,
msgFromConfig;

if (transporterOptions.smtp) {
logger.debug('Using smtp transporter config from action: %j', transporterOptions.smtp);
smtpConfig = transporterOptions.smtp;
msgFromConfig = 'from action';
} else {
logger.debug('Using smtp transporter config: %j', config.smtp);
smtpConfig = config.smtp;
msgFromConfig = 'from global';
}
var smtpAuth = smtpConfig.auth;
smtpConfig.auth = { user: 'UUU', pass: 'XXX' };
logger.debug('Using smtp transporter %j config: %j', msgFromConfig, smtpConfig);
smtpConfig.auth = smtpAuth;
transporter = nodemailer.createTransport(smtpTransport(smtpConfig));
metrics.IncMetrics(event.service, event.subservice, metrics.actionEmail);

Expand All @@ -98,6 +103,7 @@ function SendMail(action, event, callback) {
subject: mailOptions.subject,
smtp: smtpConfig
};
opt2log.smtp.auth = { user: 'UUU', pass: 'XXX' };
myutils.logErrorIf(err, util.format('emailAction.SendMail %j', opt2log));
alarm.raise(alarm.EMAIL);
} else {
Expand Down
2 changes: 1 addition & 1 deletion lib/models/smppAction.js
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ function doIt(action, event, callback) {
password = options.smpp.password;
}
}
logger.debug('smpp session on connect system_id: %s, password: %s', systemid, password);
logger.debug('smpp session on connect system_id: %s', systemid);
session.bind_transceiver(
{
system_id: systemid,
Expand Down