Skip to content

Instantly share code, notes, and snippets.

View armchairlinguist's full-sized avatar

Alexis Grant armchairlinguist

View GitHub Profile
@armchairlinguist
armchairlinguist / server.js
Last active June 12, 2017 22:34 — forked from adam-hert/server.js
winston and buffers
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 / papertrail-logspout-daemonset.yml
Created October 18, 2017 20:46
Logspout daemonset for Papertrail with Kubernetes
apiVersion: extensions/v1beta1
kind: DaemonSet
metadata:
name: logspout-papertrail
spec:
template:
metadata:
labels:
name: logspout-papertrail
spec:
@armchairlinguist
armchairlinguist / oneline_detailed_logging.rb
Last active January 3, 2020 13:45 — forked from troy/oneline_detailed_logging.rb
One-line detailed logging for Rails 3 (ActiveSupport::Notifications) and later
# 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
@armchairlinguist
armchairlinguist / deploy_hooks.yml
Last active May 29, 2020 21:50 — forked from ckraybill/deploy_hooks.yml
Cloud66 custom deploy hook for configuring papertrail to log application logs. These go in your `.cloud66` deployment folder.
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