We're experiencing difficulty. Our engineers are on it. Please check status.mailgun.com for real-time updates.

Logs

Article Preview

    Overview

    Logs offer a comprehensive overview of recent email-related events for your account, including subaccounts. You can focus on up to three event metrics, further refining results with up to ten filter dimensions. Events are displayed in an intuitive table view, with the option to export data as a CSV file.

    By default, Logs display the last 24 hours of all events.

     

    Region

    It's important to note that we keep events in our EU infrastructure separate from events in our US infrastructure, so if you don't see any events in your logs, make sure you have the correct region selected.

     

    Date/Time Range

    To change the date and/or time range, click on the date/time range selector and either pick from one of our preset ranges, or choose a custom date and time range. Please note that depending on plan level, event data is retained for up to 30 days.

     

     

    Metric Events

    By clicking on the Metric events button, you can to choose up to 3 of the following events to report on. The Apply button must be clicked for the changes to take effect.

    Definitions of the below metrics can be see here: https://help.mailgun.com/hc/en-us/articles/27939643094939-Reporting-Metrics-Counts-Rates-Dimensions

    • Accepted
    • Accepted incoming
    • Accepted outgoing
    • Bounced (all)
    • Clicked
    • Delayed bounces
    • Delayed first attempt
    • Delivered
    • Delivered first attempt
    • Delivered HTTP
    • Delivered optimized
    • Delivered SMTP
    • Delivered two plus attempts
    • ESP blocked
    • Failed (all)
    • Hard Bounces
    • Opened
    • Permanent failed
    • Permanent failed optimized
    • Processed
    • Sent
    • Soft bounces
    • Suppressed: unsubscribed
    • Suppressed: bounced
    • Suppressed: complaints
    • Temporary failed
    • Unsubscribed
    • Webhook Failed

     

    Selecting Metric events also provides accurate counts on those events from the Logs page:

     

    Filters

    To filter your events, click on the Filters and select the dimension, operator, and value that you'd like to filter. Additional filters may be added with the Add another filter button. The Apply button must be clicked for filters to to take effect.

    Filters are available on all available dimensions (except Time, which can be set with the date/time selector instead):

    • Attachment filename
    • Bot
    • Domain
    • Country
    • Delivery status bounce type
    • Delivery status code
    • Delivery status message
    • Device
    • Domain
    • Event
    • From
    • ID
    • IP Pool
    • IP
    • List
    • Message ID
    • Recipient Domain
    • Recipient Provider
    • Severity
    • Size (KB)
    • Subaccount
    • Subject
    • Tag
    • To
    • User Variables

    You may filter on these dimensions with one of four operators

    • Equals
    • Not Equals
    • Contains
    • Not Contains

     

    Event Payload

    To view the event payload:

    1. Navigate to the specific event within the table view
    2. Click the event item to expose the JSON - formatted event data

    Example payload of an Accepted event:

    {
    	"@timestamp": "2024-12-18T22:48:24.000Z",
    	"account": {
    		"id": "XXXXXXXXXXXXXXXXX"
    	},
    	"api-key-id": "d010bdaf-XXXXXXX",
    	"domain": {
    		"name": "dev.example.com"
    	},
    	"envelope": {
    		"sender": "sender@dev.example.com",
    		"targets": "to@example.com",
    		"transport": "smtp"
    	},
    	"event": "accepted",
    	"flags": {
    		"is-authenticated": true,
    		"is-routed": false,
    		"is-system-test": false,
    		"is-test-mode": false
    	},
    	"id": "icZPC3ceSlynFECB91-6OA",
    	"log-level": "info",
    	"message": {
    		"headers": {
    			"message-id": "20241218224823.5db69a3fac199381@dev.example.com",
    			"subject": "Hello",
    			"to": "to@example.com"
    		},
    		"size": 238
    	},
    	"method": "HTTP",
    	"originating-ip": "73.6.178.66",
    	"recipient": "to@example.com",
    	"recipient-domain": "example.com",
    	"storage": {
    		"env": "production",
    		"key": "BAABAAX6lCRcKHLUb3xEYbFK69-XXXXXXX",
    		"region": "us-east4",
    		"url": [
    			"https://storage-us-east4.api.mailgun.net/v3/domains/dev.example.com/messages/BAABAAX6lCRcKHLUb3xEYbFK69-XXXXX"
    		]
    	},
    	"template": {
    		"name": "001jan"
    	},
    	"user-variables": {}
    }

     

    Log Details

    To view log details including history, message rendering, and MIME:

    1. Navigate to the specific event within the table view
    2. Click on the three-dot menu to select your option

    Please note that the availability of both message rendering and MIME is tied to the message data retention limits on your plan level.

     

    Exporting Logs

    By clicking on the Export button on the upper right hand corner of the table, you can export the data in the tabular view to a csv to analyze or share. Exports are limited to 1,000 logs. Please visit https://www.mailgun.com/blog/email/your-guide-to-webhooks/ to review other ways to export your data.

     

    Need Support?

    Our Support Team here at Sinch Mailgun is happy to help! Reach out to us in the Support page of your Mailgun Control Panel, and we'll be with you shortly!