Documentation forLoggly

Integration with Github

Navigation Notice: When the APM Integrated Experience is enabled, Loggly shares a common navigation and enhanced feature set with other integrated experience products. How you navigate Loggly and access its features may vary from these instructions.

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.

Unity logs are not supported with the GitHub Integration.

Find your GitHub OAuth application name, key, and secret

When you configure Loggly's GitHub integration, you will need to know your OAuth application name, OAuth key, and OAuth secret. These are available in your OAuth application's settings. Log into your GitHub account, navigate to your GitHub Developer Settings, and click OAuth Apps.

Application already registered

If you have already registered your application, click the application's name to view that application's settings. The name at the top of the page is your OAuth Application Name, the Client ID is your OAuth Key, and the Client Secret is your OAuth Secret.

GitHub Oauth

Application not yet registered

If you have not already registered your application:

  1. Click New OAuth App.

  2. Enter a name for the application and homepage URL in the corresponding fields.
  3. Enter in the authorization callback URL field.

    Replace SUBDOMAIN with your account subdomain (which you created when you signed up for Loggly).

    Register Application

  4. Click Register application. The application's settings page loads.

    The name at the top of the page is your OAuth Application Name, the Client ID is your OAuth Key, and the Client Secret is your OAuth Secret.

    GitHub Oauth

Connect your account

In Loggly:

  1. In the navigation menu, click Source Setup > GitHub Integration.

    link github

  2. Enter the OAuth Application Name, OAuth Key, and OAuth Secret you found in GitHub in the corresponding fields.

  3. Click the drop-down menu next to Grant access to, and then select whether Loggly should look for all repositories in your organization or only public repositories.

  4. Click Connect to GitHub. Loggly will attempt to connect to your GitHub application. If prompted, select the GitHub organization you would like to connect to, click Authorize your GitHub account, and enter your GitHub credentials.

    If the credentials are correct you will see the Success message indicating that the GitHub integration connection was successful.

  5. Click Default Repository and select a repository to integrate with Loggly. Loggly will use this to match the stack trace with corresponding source code.

  6. (Optional) Match a repository's source code to exceptions in a specific source group's log data:

    1. Click the Repository drop-down menu and select the repository you would like to match against log exceptions.
    2. Click the maps to source group drop-down menu and select the source groups that contain the logs you would like matched with the selected repository. To include another source group in the match, click the plus button next to maps to source groups drop-down menu and repeat this step.
    3. To match additional repositories with a source group's log data, repeat all of Step 6.
  7. Click Save.

View your source code in Loggly Search

When a Loggly account is connected to a git repository, stack traces 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 the tag icons.

The source code opens 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.

View commits

To view the commits to the code, you could also click the Commits tab, as shown below.

GitHub commits

The list includes the Author, Commit, Message and Date of the commit and is sorted by date and time in descending order. The list allows you to check the latest commits to the code directly within Loggly. Alternatively, you can click View in GitHub to see the code in GitHub.

Create GitHub issues or add comments

After connecting with GitHub you can create GitHub issues or add comments 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.

  1. Click the hamburger menu from the action bar (three vertical dots) for the event in question. Click Create issue under the GitHub section.

    Create Issue

  2. In the Create a new GitHub issue window, provide the required details in the issue fields.

  3. After entering the details, click Create issue. A confirmation dialogue displays at the top to indicate that the issue has been created in your GitHub account via this integration.

To add a comment to an existing issue from a Loggly error event:

  1. Select the repository and select the GitHub issue that needs a comment.
  2. Enter text under the comment window.
  3. Add a check mark to enable (or clear to disable). Include event details in the comment.
  4. Add a check mark to enable (or clear to disable). Include a permalink in the comment.
  5. Click Add to add the comment to the GitHub issue. A confirmation message displays at the top indicating the comment was added successfully.