___
__ /\_ \
___ /\_\ ___ ___ __ __ ___ \//\ \ ___ __ __ __ _ __
/'___\/\ \ /' _ `\ / __`\/\ \/\ \ / __`\ _______\ \ \ / __`\ /'_ `\ /'_ `\ /'__`\/\`'__\
/\ \__/\ \ \/\ \/\ \/\ \L\ \ \ \_/ |/\ \L\ \/\______\\_\ \_/\ \L\ \/\ \L\ \/\ \L\ \/\ __/\ \ \/
\ \____\\ \_\ \_\ \_\ \____/\ \___/ \ \____/\/______//\____\ \____/\ \____ \ \____ \ \____\\ \_\
\/____/ \/_/\/_/\/_/\/___/ \/__/ \/___/ \/____/\/___/ \/___L\ \/___L\ \/____/ \/_/
/\____/ /\____/
\_/__/ \_/__/
cinovo-logger-aws
AWS S3, SNS or SQS endpoint for cinovo-logger.
Getting started
At first you must install and require the logger.
npm install cinovo-logger
Next you must require the module
var logger = ;
Append cinovo-logger-aws endpoint
npm install cinovo-logger-aws
In your JavaScript code append the S3 endpoint.
and / or append the SNS endpoint.
logger;
and / or append the SQS endpoint.
logger;
Log something
logger;logger;logger;logger;logger;
Done
Now you can log to AWS S3, SNS or SQS endpoints.
API
sns(debug, info, error, critial, region, topicArn, [accessKeyId, secretAccessKey])
Sync creates an SNS endpoint.
debug
: Boolean - true if the endpoint should log debug levelinfo
: Boolean - true if the endpoint should log info levelerror
: Boolean - true if the endpoint should log error levelcritical
: Boolean - true if the endpoint should log critical levelregion
: String - your AWS regiontopicArn
: String - the topic you want to publish toaccessKeyId
: String - your AWS access key ID (optional)secretAccessKey
: String - your AWS secret access key (optional)
return
: Endpoint - use the endpoint like this logger.append(endpoint)
sqs(debug, info, error, critial, region, queueUrl, [accessKeyId, secretAccessKey])
Sync creates an SQS endpoint.
debug
: Boolean - true if the endpoint should log debug levelinfo
: Boolean - true if the endpoint should log info levelerror
: Boolean - true if the endpoint should log error levelcritical
: Boolean - true if the endpoint should log critical levelregion
: String - your AWS regionqueueUrl
: String - the URL of the SQS queue to take action onaccessKeyId
: String - your AWS access key ID (optional)secretAccessKey
: String - your AWS secret access key (optional)
return
: Endpoint - use the endpoint like this logger.append(endpoint)
s3(debug, info, error, critial, dir, fileSuffix, filePrefix, maxFileSize, maxFileAge, maxFiles, region, bucket, bucketDir, accessKeyId, secretAccessKey, callback)
Async creates an cinovo-logger-file endpoint to copy log files into S3 on roll or stop.
debug
: Boolean - true if the endpoint should log debug levelinfo
: Boolean - true if the endpoint should log info levelerror
: Boolean - true if the endpoint should log error levelcritical
: Boolean - true if the endpoint should log critical leveldir
: String - directory in which log files are saved.filePrefix
: String -fileSuffix
: String -maxFileSize
: Number - bytesmaxFileAge
: Number - secondsmaxFiles
: Number - Maximum Number of files in dir (oldest are removed first)region
: String - your AWS regionbucket
: String - your AWS bucke namebucketDir
: String or Function - your AWS bucket "directory" (e. g. logs/ or logs/a/b/)accessKeyId
: String - your AWS access key ID (optional)secretAccessKey
: String - your AWS secret access key (optional)callback
: Function(err, endpoint) - fired if the endpoint is ready to useerr
: Error (optional)endpoint
: Endpoint - use the endpoint like this logger.append(endpoint)
s3watcher(endpoint, region, bucket, bucketDir, [accessKeyId, secretAccessKey])
Sync takes an cinovo-logger-file endpoint to copy log files into S3 on roll or stop.
endpoint
: FileEndpointregion
: String - your AWS regionbucket
: String - your AWS bucke namebucketDir
: String or Function - your AWS bucket "directory" (e. g. logs/ or logs/a/b/)accessKeyId
: String - your AWS access key ID (optional)secretAccessKey
: String - your AWS secret access key (optional)
Events
error(err)
If the file can not be copied to S3 during roll.
err
: Error
s3Copy(file, etag)
file
: String - name of file that was copied (without path)etag
: String - AWS entity tag for the uploaded object