Skip to content

Commit

Permalink
fix(logs): log bounce events to graylog
Browse files Browse the repository at this point in the history
  • Loading branch information
andris9 committed Feb 9, 2024
1 parent ec0b568 commit b3b8773
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 19 deletions.
29 changes: 16 additions & 13 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -1218,20 +1218,23 @@ module.exports.init = function (app, done) {
break;

case 'QUEUE_POLL':
{
message.short_message = `[QUEUE_POLL] ${entry.query?.sendingZone}`;
message._mail_action = 'queue_poll';

message._queue_poll_zone = (entry.query?.sendingZone || '').toString();
message._queue_poll_lte = entry.query?.queued?.$lte?.toISOString();
message._queue_poll_instance = entry.query?.$or?.at(-1)?.assigned;

message._queue_poll_skip_domains = entry.query?.domain?.$nin?.join(', ');

message._queue_poll_match = entry.match ? 'yes' : 'no';
message.short_message = `[QUEUE_POLL] ${entry.query?.sendingZone}`;
message._mail_action = 'queue_poll';
message._queue_poll_zone = (entry.query?.sendingZone || '').toString();
message._queue_poll_lte = entry.query?.queued?.$lte?.toISOString();
message._queue_poll_instance = entry.query?.$or?.at(-1)?.assigned;
message._queue_poll_skip_domains = entry.query?.domain?.$nin?.join(', ');
message._queue_poll_match = entry.match ? 'yes' : 'no';
message._error = entry.error;
break;

message._error = entry.error;
}
case 'QUEUE_BOUNCE':
message.short_message = `[QUEUE_BOUNCE] ${entry.bounceType}`;
message._mail_action = 'queue_bounce';
message._queue_bounce_queued = (entry.queued || '').toString();
message._queue_bounce_type = entry.bounceType;
message._queue_bounce_id = entry.bounceId;
message._error = entry.error;
break;
}

Expand Down
12 changes: 6 additions & 6 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit b3b8773

Please sign in to comment.