
Security News
Rspack Introduces Rslint, a TypeScript-First Linter Written in Go
Rspack launches Rslint, a fast TypeScript-first linter built on typescript-go, joining in on the trend of toolchains creating their own linters.
Rack middleware to log all API request details into a rotating CSV log file.
Install the gem and add to the application's Gemfile by executing:
bundle add api_hit_logger
If bundler is not being used to manage dependencies, install the gem by executing:
gem install api_hit_logger
To enable request logging with ApiHitLogger, simply add the middleware to your Rails or Rack-based application:
Require the gem In your config/application.rb or equivalent setup file: require 'api_hit_logger'
Add the middleware
For Rails: config/application.rb config.middleware.use ApiHitLogger::Middleware
For Rack apps, update your config.ru: use ApiHitLogger::Middleware
Once set up, all incoming HTTP requests will be logged to a CSV file in the log/ directory, with a separate file generated for each day.
No additional configuration is required for basic usage.
Log File Location The logs are written to: log/api_hit_logs_YYYY-MM-DD.csv
Each day's requests are stored in their own CSV/JSON file.
To customize how API hits are logged, create a file at:
With the following content:
ApiHitLogger.configure do |config|
# Format options: :csv, :json (default: :csv)
config.log_format = :csv
end
If no initializer is present, default settings will be used.
## Development
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and the created tag, and push the `.gem` file to [rubygems.org](https://rubygems.org).
## Contributing
Bug reports and pull requests are welcome on GitHub at https://github.com/chaitanyag1-c/api_hit_logger. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [code of conduct](https://github.com/chaitanyag1-c/api_hit_logger/blob/master/CODE_OF_CONDUCT.md).
## License
The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
## Code of Conduct
Everyone interacting in the ApiHitLogger project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/chaitanyag1-c/api_hit_logger/blob/master/CODE_OF_CONDUCT.md).
FAQs
Unknown package
We found that api_hit_logger demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer 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
Rspack launches Rslint, a fast TypeScript-first linter built on typescript-go, joining in on the trend of toolchains creating their own linters.
Security News
Hacker Demonstrates How Easy It Is To Steal Data From Popular Password Managers
Security News
Oxlint’s new preview brings type-aware linting powered by typescript-go, combining advanced TypeScript rules with native-speed performance.