Skip to content

Instantly share code, notes, and snippets.

Avatar

Alexis Grant armchairlinguist

View GitHub Profile
@armchairlinguist
armchairlinguist / papertrail-logspout-daemonset.yml
Created Oct 18, 2017
Logspout daemonset for Papertrail with Kubernetes
View papertrail-logspout-daemonset.yml
apiVersion: extensions/v1beta1
kind: DaemonSet
metadata:
name: logspout-papertrail
spec:
template:
metadata:
labels:
name: logspout-papertrail
spec:
@armchairlinguist
armchairlinguist / deploy_hooks.yml
Last active May 29, 2020 — forked from ckraybill/deploy_hooks.yml
Cloud66 custom deploy hook for configuring papertrail to log application logs. These go in your `.cloud66` deployment folder.
View deploy_hooks.yml
production:
after_symlink:
- source: /.cloud66/log_files.yml
destination: /etc/log_files.yml
sudo: true
target: any
apply_during: all
- source: /.cloud66/remote_syslog.init.d
destination: /etc/init.d/remote_syslog
@armchairlinguist
armchairlinguist / server.js
Last active Jun 12, 2017 — forked from adam-hert/server.js
winston and buffers
View server.js
var sleep = require('system-sleep');
var winston = require('winston');
require('winston-papertrail').Papertrail
const winstonConsole = new winston.transports.Console()
const winstonPapertrail = new winston.transports.Papertrail({
host: 'logsN.papertrailapp.com',
port: xxxxx,
flushOnClose: true,
})
@armchairlinguist
armchairlinguist / oneline_detailed_logging.rb
Last active Jan 3, 2020 — forked from troy/oneline_detailed_logging.rb
One-line detailed logging for Rails 3 (ActiveSupport::Notifications) and later
View oneline_detailed_logging.rb
# Outputs this at warn log level:
# 1.2.3.4 GET /path 200 OK BlahController#action HTML 938.2 (DB 11.8, View 719.7) {params} {optional params from flash[:log]}
#
# Save as config/initializers/oneline_detailed_logging.rb. Consider
# decreasing the log level from "info" to "warn" (in production.rb) so
# the one-line log message replaces the standard request logs.
# override process_action to add 2 things to the payload:
# - remote IP