From 17ad1ed502efed1e5c4d4121402b5d1d3b464e74 Mon Sep 17 00:00:00 2001 From: Michael Staub Date: Tue, 17 Apr 2018 19:55:14 -0700 Subject: [PATCH] move host variable assignment for greater flexibility --- src/index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/index.js b/src/index.js index 0274805..54cbbd3 100644 --- a/src/index.js +++ b/src/index.js @@ -20,8 +20,6 @@ class PapertrailLogging { if (!_.has(this.service, 'custom.papertrail.port')) { throw new this.serverless.classes.Error('Configure Papertrail port in custom.papertrail.port of the serverless.yml'); } - - this.papertrailHost = _.get(this.service, 'custom.papertrail.host', 'logs.papertrailapp.com'); } static getFunctionName() { @@ -40,6 +38,8 @@ class PapertrailLogging { fs.mkdirSync(functionPath); } + this.papertrailHost = _.get(this.service, 'custom.papertrail.host', 'logs.papertrailapp.com'); + const loggerFunctionFullName = `${this.service.service}-${this.service.provider.stage}-${PapertrailLogging.getFunctionName()}`; _.merge( this.service.provider.compiledCloudFormationTemplate.Resources,