Logentries Docs

Find comprehensive guides and documentation to help you start and continue to work with Logentries.

    

Search results for "{{ search.query }}"

No results found for "{{search.query}}".
View All Results

Logentries provides direct support using our iOS library.

Setup

Log in to Logentries and create a new log by clicking the Add New Log button. Now click Manual Configuration button from the list of options. Give your log a name of your choice, select Token TCP and finally click the Register new log button. A token will be displayed in green. Please record it as we will use it later to configure the library.

Install Logging Library

  1. Download the lelib iOS Library from the Logentries GitHub page – Add files from lelib group into your project
  2. Include the Lirbary in your view controller interface (ViewController.h) by importing the “lelib.h” file.
#import <UIKit/UIKit.h>
#import "lelib.h"

@interface ViewController : UIViewController

@end
  1. In your implementation file (ViewController.m) Initialize the LELog singleton. In the example below, this has been done in the viewDidLoad method
- (void)viewDidLoad {
    [super viewDidLoad];
    
    LELog* logger = [LELog sharedInstance];
}
  1. In the set the logger.token variable by replacing the LOGENTRIES_TOKEN String with your specific Logentries Log token (created from the steps outlined at the top of this page)
- (void)viewDidLoad {
    [super viewDidLoad];
    
    LELog* logger = [LELog sharedInstance];

    // Replace the LOGENTRIES_TOKEN String with your specific Log's Token
    logger.token = @"LOGENTRIES_TOKEN";
}
  1. Send a log using the logger instance: [logger log:@”Hello Logentries!”];
- (void)viewDidLoad {
    [super viewDidLoad];
    
    LELog* logger = [LELog sharedInstance];

    // Replace the LOGENTRIES_TOKEN String with your specific Log's Token
    logger.token = @"LOGENTRIES_TOKEN";

    [logger log:@"Hello Logentries"];
}
  1. Run your iOS application in your simulator or on your iOS device. These must have a valid network connection in order to send the data to the Logentries’ website. In the code above, be sure to replace LOGENTRIES_TOKEN with the Logentries Token from your specific Log (the one you created at the top of the page).

If you didn’t copy this Token when creating your log, don’ t worry you can get it from your Web UI at any time. To acquire your log’s Token for putting in this code simply navigate to your Host / Log Set (e.g. from the side bar on the left hand side of the page). This will bring up the list of Logs for that given Host / Log Set. Select the token button to the far right of the Web UI that corresponds to your specific log. Click this icon to display the token

iOS