Skip to content

Instantly share code, notes, and snippets.

View shah743's full-sized avatar
🏠
Working from home

Shah Zaib shah743

🏠
Working from home
  • Islamabad, PK
View GitHub Profile
@shah743
shah743 / 00_README.md
Created November 20, 2020 19:28 — forked from mikechau/00_README.md
Logging Rails 4 to Syslog, formatted w/ Logstash

Logging Rails 4 to Syslog, formatted w/ Logstash

Getting Started

Steps to get Rails 4 saving its output to Syslog via Rsyslog. This assumes you are on CentOS, but should be pretty adaptable to any other distribution. Ruby 2.0+ is also required.

  1. Add the gems lograge and logstash-event to your Gemfile. Feel free to remove from production if you'd like to test it in development as well or something.
  2. Update production.rb with the lograge settings and set the logger to Syslog::Logger.
  3. Add the conf files to /etc/rsyslog.d/. /etc/rsyslog.conf should have $IncludeConfig /etc/rsyslog.d/*.conf enabled, so it will load any additional configs from /etc/rsyslog.conf.
@shah743
shah743 / ror-api.markdown
Created June 9, 2022 05:22 — forked from withoutwax/ror-api.markdown
Guide on how to create an API-Only Application with Ruby on Rails 5

Creating an API-Only Application with Ruby on Rails

01 - Create a new API-only Rails app

rails new ror-app-name --api

02 - Basic Scaffold

01 - Model

This step is for creating a very basic level of model for us to work in. If you know already, or wish to apply your own custom models with relationships you can skip this step.