Skip to content

Commit

Permalink
Add an example
Browse files Browse the repository at this point in the history
  • Loading branch information
chilts committed Nov 20, 2011
1 parent 1f3b9d4 commit 0cf0ec8
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 0 deletions.
10 changes: 10 additions & 0 deletions examples/options.js.example
@@ -0,0 +1,10 @@
var amazon = require('awssum/lib/amazon/amazon');

exports = module.exports = {
accessKeyId : '1234567890abcdefghil',
secretAccessKey : '1234567890abcdefghil1234567890abcdefghil',
awsAccountId : '1234-1234-1234',
domainName : 'log',
region : amazon.US_EAST_1,
itemName : 'uuid',
};
22 changes: 22 additions & 0 deletions examples/test-logger.js
@@ -0,0 +1,22 @@
var winston = require('winston');
var SimpleDB = require('../winston-simpledb').SimpleDB;
var options = require('./options');

// Copy the options.js.example file in this directory, name it options.js
// and add in your AWS credentials.
winston.add(winston.transports.SimpleDB, options );

// do an info log
winston.log('info', 'Hello distributed log files!', function() {
console.log('First message logged');
});

// do another info log
winston.info('Hello again distributed logs', function() {
console.log('Second message logged');
});

// log with metadata
winston.info('With some metadata', { tag : 'cloud' }, function() {
console.log('Third message logged');
});

0 comments on commit 0cf0ec8

Please sign in to comment.