Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
For those who dealt with Sinatra Logging, and tried to configure it correctly (i.e. have Access logs, Error logs, and the normal logger
functionality), they know how messy that is. Sinatra logging configuration is painful. To get a better understanding, refer to:
If you come from a Rails background, you are probably used to the simplicity of:
logger.info "some info"
logger.debug "some debugging"
...
We offer a slightly "better looking" option using our library.
This library is an interface for SemanticLogger
library (found here: https://github.com/rocketjob/semantic_logger). It just does the wiring for your Sinatra
app, and gets you up and running with a simple line of code.
Please, check the SemanticLogger
(http://rocketjob.github.io/semantic_logger/) to get a glimpse of their pretty neat logging solution.
Add this line to your application's Gemfile:
gem 'sinatra-logger', '>= 0.2.6'
And then execute:
$ bundle
Or install it yourself as:
$ gem install sinatra-logger -v '>= 0.2.6'
We assume that you use either: Sinatra::Base
or Sinatra::Application
.
class MyApp < Sinatra::Base
logger filename: "log/#{settings.environment}.log", level: :trace
# ... remaining code ...
end
class App1 < Sinatra::Application
# ... some App1 routes/code ...
end
class App2 < Sinatra::Application
# ... some App1 routes/code ...
end
class ContainerApp < Sinatra::Application
logger filename: "log/#{settings.environment}.log", level: :trace
use App1
use App2
# ... remaining code ...
end
NOTE: You need to only use logger filename: "", level: :trace
only once (precisely in the container app).
require 'sinatra/logger' # not 'sinatra-logger'
This gem is still in its beta phase. If you spot any errors, or propose some improvements, contact us: github [at] minodes [dot] com
Bug reports and pull requests are welcome on GitHub at https://github.com/minodes/sinatra-logger. We would love to see your suggestions, fixes or improvements.
logger.info
, ...)The gem is available as open source under the terms of the MIT License.
FAQs
Unknown package
We found that sinatra-logger demonstrated a not healthy version release cadence and project activity because the last version was released 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.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.