Security News
Fluent Assertions Faces Backlash After Abandoning Open Source Licensing
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
Welcome to our Rails logger gem!
This is a simple logger that is easy to use and can be configured as you want.
Add this line to your application's Gemfile:
gem 'oxy_logger', '~> 0.3.0'
Then run:
$ bundle install
To include gem tasks inside your rails app.
Add this code to rails Rakefile
:
spec = Gem::Specification.find_by_name 'oxy_logger'
load "#{spec.gem_dir}/lib/tasks/logger_install.rake"
Then run the rake task.
This command will create a configuration file in your application and run the migration
to update your database.
$ rake oxy:install
In order to log the controller methods, add in app/controllers/application_controller.rb
Do the same code for the Model, if you need to log it app/models/application_record.rb
extend OxyLogger::Sys
include OxyLogger::Helper
And at the end, specify what methods you want to use for logging.
IMPORTANT! The method log_it
must be at the end of the logged methods.
logg_it [ :index, :show, :new, :edit, :create, :update, :destroy ] # Select any of the available methods
Very simple isn't?
When you launched the rake task a configuration file was copied into your project, which you can find at /config/initializers/logger_init.rb
OxyLogger.configure do |config|
# Save logs locally to a file or database
config.save_to = "file" # or config.save_to = "db"
If you want to log to a file, you can specify the path to it. If this file does not exist, the OxyLogger will create it.
# config.files_path = Rails.root + "/log/logged_data" # the same things in example
config.files_path = Rails.root.join('log', 'logged_data')
You can choose which parameters you want to record. Unnecessary parameter just comment out or delete.
config.logget_fields = %i[
date_time # called time
class_name # class in which was called
method_name # method in which was called
result # return result
params # parameters
]
We will be very happy if our product interests you and you will have an irresistible desire to help us with its development.
https://github.com/[USERNAME]/oxy_logger.
The gem is available as open source under the terms of the MIT License.
FAQs
Unknown package
We found that oxy_logger demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 3 open source maintainers collaborating on the project.
Did you know?
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.
Security News
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
Research
Security News
Socket researchers uncover the risks of a malicious Python package targeting Discord developers.
Security News
The UK is proposing a bold ban on ransomware payments by public entities to disrupt cybercrime, protect critical services, and lead global cybersecurity efforts.