Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

logutils-activerecord

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

logutils-activerecord

  • 0.2.1
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

logutils-activerecord - Another Logger - Addon for Database Support (LogDb, Log Model etc.)

Usage

Log to the database using LogDb

NB: To use the LogDb machinery require the module, that is, issue:

require 'logutils/activerecord'

To create the database tables use:

LogDb.create

To start logging to the database (established connection required) use:

LogDb.setup

To clean out all log records from the database use:

LogDb.delete!

All together now

require 'logutils'
require 'logutils/activerecord'   # NOTE: will also require 'active_record'

include LogUtils    # lets you use Logger instead of LogUtils::Logger

logger = Logger[ 'Test' ]
logger.info 'hello LogUtils'

LOG_DB_CONFIG = {
  adapter:   'sqlite3',
  database:  './log.db'
}

pp LOG_DB_CONFIG
ActiveRecord::Base.establish_connection( LOG_DB_CONFIG )

LogDb.create
LogDb.setup

logger.info 'hola LogUtils'
logger.warn 'servus LogUtils'

That's it.

License

The logutils-activerecord scripts are dedicated to the public domain. Use it as you please with no restrictions whatsoever.

FAQs

Package last updated on 28 Feb 2015

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc