
Security Fundamentals
Obfuscation 101: Unmasking the Tricks Behind Malicious Code
Attackers use obfuscation to hide malware in open source packages. Learn how to spot these techniques across npm, PyPI, Maven, and more.
Scrolls is a library for generating logs of the structure key=value
.
Add this line to your application's Gemfile:
gem 'scrolls'
And then execute:
$ bundle
Or install it yourself as:
$ gem install scrolls
Scrolls follows the belief that logs should be treated as data. One way to think of them is the blood of your infrastructure. Logs are a realtime view of what is happening on your systems.
require 'scrolls'
Scrolls.init(
timestamp: true,
global_context: {app: "scrolls", deploy: "production"},
exceptions: "multi"
)
Scrolls.log(at: "test")
Scrolls.context(context: "block") do
Scrolls.log(at: "exec")
end
begin
raise
rescue Exception => e
Scrolls.log_exception(e, at: "raise")
end
You can also use Scrolls#log
and Scrolls#log_exception
without initalizing:
require 'scrolls'
Scrolls.log(test: "test")
Here are the defaults Scrolls#init
:
stream: STDOUT
facility: Syslog::LOG_USER
time_unit: "seconds"
timestamp: false
exceptions: "single"
global_context: {}
syslog_options: Syslog::LOG_PID|Syslog::LOG_CONS
escape_keys: false
strict_logfmt: false
require 'scrolls'
Scrolls.add_timestamp = true
Scrolls.global_context(:app => "scrolls", :deploy => "production")
Scrolls.log(:at => "test")
Scrolls.context(:context => "block") do
Scrolls.log(:at => "exec")
end
begin
raise
rescue Exception => e
Scrolls.log_exception(:at => "raise", e)
end
Produces:
now="2017-09-01T00:37:13Z" app=scrolls deploy=production at=test
now="2017-09-01T00:37:13Z" app=scrolls deploy=production context=block at=exec
now="2017-09-01T00:37:13Z" app=scrolls deploy=production at=exception class=RuntimeError exception_id=70149797587080
now="2017-09-01T00:37:13Z" app=scrolls deploy=production at=exception class=RuntimeError exception_id=70149797587080 site="./test-scrolls.rb:16:in <main>"
This library originated from various logging methods used internally at Heroku. Starting at version 0.2.0 Scrolls was ripped apart and restructured to provide a better foundation for the future. Tests and documentation were add at that point as well.
Thanks to the following people for influencing this library.
MIT License
FAQs
Unknown package
We found that scrolls 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 Fundamentals
Attackers use obfuscation to hide malware in open source packages. Learn how to spot these techniques across npm, PyPI, Maven, and more.
Security News
Join Socket for exclusive networking events, rooftop gatherings, and one-on-one meetings during BSidesSF and RSA 2025 in San Francisco.
Security News
Biome's v2.0 beta introduces custom plugins, domain-specific linting, and type-aware rules while laying groundwork for HTML support and embedded language features in 2025.