Skip to content

Commit

Permalink
Add message_type support to logging resources
Browse files Browse the repository at this point in the history
This will enable specifying a `message_type` of `blank` which is needed
for JSON formatted log lines.

Signed-off-by: Seth Chisamore <schisamo@chef.io>
  • Loading branch information
schisamo committed Feb 3, 2017
1 parent 338040b commit e49f153
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 2 deletions.
10 changes: 9 additions & 1 deletion lib/fastly/s3_logging.rb
@@ -1,7 +1,7 @@
class Fastly
# An s3 endpoint to stream logs to
class S3Logging < BelongsToServiceAndVersion
attr_accessor :service_id, :name, :bucket_name, :access_key, :secret_key, :path, :period, :gzip_level, :format, :format_version, :response_condition, :timestamp_format, :domain, :redundancy
attr_accessor :service_id, :name, :bucket_name, :access_key, :secret_key, :path, :period, :gzip_level, :format, :format_version, :message_type, :response_condition, :timestamp_format, :domain, :redundancy

##
# :attr: service_id
Expand Down Expand Up @@ -61,6 +61,14 @@ class S3Logging < BelongsToServiceAndVersion
# Can be either 1 (the default, version 1 log format) or 2 (the version 2
# log format).

##
# :attr: message_type
#
# How the message should be formatted. Can be either classic (RFC 3164
# syslog prefix), loggly (RFC 5424 structured syslog), logplex (Heroku-style
# length prefixed syslog), or blank (No prefix. Useful for writing JSON and
# CSV).

##
# :attr: response_condition
#
Expand Down
10 changes: 9 additions & 1 deletion lib/fastly/syslog.rb
@@ -1,7 +1,7 @@
class Fastly
# An endpoint to stream syslogs to
class Syslog < BelongsToServiceAndVersion
attr_accessor :service_id, :name, :comment, :ipv4, :ipv6, :hostname, :port, :token, :format, :format_version, :response_conditions, :use_tls, :tls_hostname, :tls_ca_cert
attr_accessor :service_id, :name, :comment, :ipv4, :ipv6, :hostname, :port, :token, :format, :format_version, :message_type, :response_conditions, :use_tls, :tls_hostname, :tls_ca_cert

##
# :attr: service_id
Expand Down Expand Up @@ -70,6 +70,14 @@ class Syslog < BelongsToServiceAndVersion
# Can be either 1 (the default, version 1 log format) or 2 (the version 2
# log format).

##
# :attr: message_type
#
# How the message should be formatted. Can be either classic (RFC 3164
# syslog prefix), loggly (RFC 5424 structured syslog), logplex (Heroku-style
# length prefixed syslog), or blank (No prefix. Useful for writing JSON and
# CSV).

##
# :attr: response_condition
#
Expand Down

0 comments on commit e49f153

Please sign in to comment.