GitHub integration to Loggly
Loggly’s GitHub integration makes it easy to view the source code related to a Loggly event. You can also identify what changes were made recently to the source code, send your Loggly event items to GitHub Issues, link your stack traces to the code where it happened, resolve items when a particular commit is deployed, and show the commits that were included with each deploy. Loggly can integrate with JIRA and GitHub, so you can manage Loggly-detected errors in your existing workflow.
This capability is supported for Python, Java, PHP 5.6 and 7.0 and C# exceptions at this time.
1. Connect your Account
Get started by going to the Source Setup page. Navigate to the GitHub Integration tab and complete the one time setup as shown below:
1. Link to GitHub
OAuth Application Name: Enter the OAuth Application Name that you want to Link with Loggly.
OAuth Key: Enter the OAuth Key. You can register your application by going to https://github.com/settings/developers and clicking on New OAuth App.
Authorization callback URL: Under Developer settings -> OAuth Apps make sure that your authorization callback URL is set to
https://<subdomain>.loggly.com/integrations/github/ Replace <subdomain> with your Loggly subdomain
After registering your app, you will get the OAuth key and the secret as shown below:
Grant access to: Select the Repositories for which you want to allow access via this integration.
Once you have entered the credentials, click on the ‘Connect to GitHub’ button. If the credentials are correct you will see the Success message indicating that the GitHub integration connection was successful.
2. Set default
Set the default repository from the list of available repositories, then enter default branch (default is ‘master’). Loggly will use this to match the stack trace with corresponding source code.
3. Map GitHub to Loggly (optional)
You can map repositories and branches in GitHub to source groups in Loggly.
2. Viewing your Source Code in Loggly Search
When a Loggly account is connected to a git repository, stack traces will include links to each file in the code version where the error was most recently activated.
Find a stack trace in the Loggly Event Viewer. Move the mouse over the Source code tags and click on the tag icons.
This will open the source code from GitHub directly in the Loggly Event Viewer, as shown below, along with other important details such as Author, Commit Message and Date. You can click on View in GitHub if you want to see the source code directly within the GitHub account.
3. View Commits
To view the commits to the code, you could also click on the Commits tab, as shown below.
This will list the Author, Commit, Message and Date of the commit and this list will be sorted by date and time in descending order. This allows you to check the latest commits to the code directly within Loggly. Alternatively, you can click the “View in GitHub” button to see the code in GitHub.
4. Create GitHub Issues
After connecting with GitHub you can create GitHub issues directly from events in the Loggly Search page.
When Loggly is connected to your issue tracker you can manually create an issue to track an error/event seen under the Loggly search page. You can do this by clicking on the action bar from the event in question. Click on the Create issue button under the GitHub section.
A window will open as shown below. Fill in the required details:
Title: Enter the issue title.
Description: Enter a brief description.
Check or uncheck to enable/disable Include event details in description.
Check or uncheck to enable/disable Include permalink in description.
Repository: Select the appropriate directory. If you have selected a default repository, it will be shown by default.
Milestone: Select an appropriate milestone.
Labels: Select a label.
Assignee: Select an assignee for the issue.
After entering the details, click on the “Create issue” button. You will get a confirmation dialogue at the top to indicate that the issue has been created in your GitHub account via this integration.
5. Add Comment
You can also Add Comment to an existing issue from a Loggly error event.
Select the repository and then select the GitHub issue where you want to enter the comments.
Enter the text under the comment window.
Check or uncheck to enable/disable Include event details in comment.
Check or uncheck to enable/disable Include permalink in comment.
Then Click on Add to add the comment to the GitHub issue.
You will get a confirmation message at the top indicating that the comment was added successfully.