
Research
Malicious npm Packages Impersonate Flashbots SDKs, Targeting Ethereum Wallet Credentials
Four npm packages disguised as cryptographic tools steal developer credentials and send them to attacker-controlled Telegram infrastructure.
ElasticLogger is a simple and elastic (;)) solusion for sending JSON logs to elasticsearch but not only there. It works based on writers. Each writer is used to send logs to diffrent destination. Gem is released with two writers one for ElasticSearch and one for standard log files. You can also create your own Writer and use it in config file.
Add this line to your application's Gemfile:
gem 'elastic-logger'
And then execute:
$ bundle
Or install it yourself as:
$ gem install elastic-logger
There is a generator for Rails which will create base intialize and config files.
bundle exec rails generate elastic_logger
require 'elastic-logger'
# Configuration
ElasticLogger.configure do |config|
config.host = '192.168.60.10:9200'
types_file = 'config/elastic_log_config.yml'
path = 'log'
prefix = ''
end
With this file we create two logs, one which will log to elastic, and one to standard log file.
sidekiq_monitor:
writer: 'InfaktLogger::ElkWriter'
level: 'debug' # log level, one of debug, error, fatal, info, unknown, and warn
delete:
type: 'standard' # never if you want to keep that log
unit: 'days' # One of seconds, minutes, hours, days, weeks, months, or years.
unit_count: 2 # The number of unit (s). unit_count * unit will be calculated out to the relative number of seconds.
backup:
type: 'standard' # infinite if you want to keep that log, never for no backups
unit: 'days' # One of seconds, minutes, hours, days, weeks, months, or years.
unit_count: 2 # The number of unit (s). unit_count * unit will be calculated out to the relative number of seconds.
api_requests:
writer: 'InfaktLogger::DiskWriter'
level: 'warn'
sidekiq_monitor
is a name of log it will be used with prefix
to build file name or index name in elastic.
logger = ElasticLogger::Logger.new('sidekiq_monitor')
logger.log(foo: :bar)
Creates daily index named after log name. For sidekiq_monitor it will creates sidekiq_monitr-%Y.%m.%d
index each day, with sidekiq_monitor
type and injects there hashes from user input. Next you can go to Kibana and search in it.
It is use by us mostly on devels, when we don't want to use elk for logs. Internally it use ruby Logger
.
You can create your own writer. It needs two mtethods:
initialize
with name
and config
named paramslog
with one params with is hash to log.# Capfile
require 'elastic-logger/capistrano'
Index in elasticsearch will be updated after deploy, with all used elk logs.
git checkout -b my-new-feature
)git commit -am 'Add some feature'
)git push origin my-new-feature
)FAQs
Unknown package
We found that elastic-logger demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 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.
Research
Four npm packages disguised as cryptographic tools steal developer credentials and send them to attacker-controlled Telegram infrastructure.
Security News
Ruby maintainers from Bundler and rbenv teams are building rv to bring Python uv's speed and unified tooling approach to Ruby development.
Security News
Following last week’s supply chain attack, Nx published findings on the GitHub Actions exploit and moved npm publishing to Trusted Publishers.