Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Sylvain Perron
committed
Feb 3, 2015
1 parent
1227ae5
commit bdd4b67
Showing
2 changed files
with
52 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
var lawgs = require('./index'); | ||
|
||
// Lawgs configuration is mandatory | ||
lawgs.config({ | ||
aws: { | ||
accessKeyId: '********', /* Optional is credentials are set in ~/.aws/credentials */ | ||
secretAccessKey: '******', /* Optional */ | ||
region: 'us-east-1' /* Required */ | ||
} | ||
}); | ||
|
||
var logger = lawgs.getOrCreate('SuperbowlLogs'); /* LogGroup */ | ||
var logger2 = lawgs.getOrCreate('SuperbowlLogs'); /* Returns the same instance (caching factory) */ | ||
|
||
// Logger configuration is optional | ||
logger.config({ | ||
// Shows the debugging messages | ||
showDebugLogs: true, /* Default to false */ | ||
// Change the frequency of log upload, regardless of the batch size | ||
uploadMaxTimer: 1000, /* Defaults to 5000ms */ | ||
// Max batch size. An upload will be triggered if this limit is reached within the max upload time | ||
uploadBatchSize: 10 /* Defaults to 500 */ | ||
}); | ||
|
||
/* 'error' is the log stream name */ | ||
logger.log('error', 'Argggg'); // Takes a string | ||
|
||
logger.log('touchdown', { // or any serializable object | ||
team: 'Patriots', | ||
weight: 7 | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters