Comments (3)
Part of the confusion in this environment is over differing opinions on where to draw the line between java-way and ruby-way. I've generally sided on the ruby side for the configuration topic, but for logging in particular I've tried to keep it flexible enough to support all SLF4J output adaptors and config options.
custom launcher
You mention writing your own start script. I encourage that and typically do the same. This allows you total control of all details. I've packaged several complete sinatra apps as gems with fishwife and rjack-logback as dependencies. One public example is: https://github.com/dekellum/boxed-geminabox
In particular: https://github.com/dekellum/boxed-geminabox/blob/master/init/boxed-geminabox
- Hashdot headers for daemonizing, log redirection, and integration with Iyyov process monitor (Might explain why I am less interested in Mizuno's later attempts at process control.)
- Logback custom configuration specific to the daemon/production mode.
- Using Hooker to externalize a minimal set of application and deployment-specific configuration (see also config/config.rb sample in same repo)
fishwife launcher
In general fishwife
or rackup
make good quick demonstration launchers, or for config.ru compatibility with other servers. The intent with fishwife
is to bring up a basic but functioning log output. If you want logback as the output adaptor, why not gem install rjack-logback
or include via bundler? Then, if you really want to use a logback.xml instead of ruby based config, you can do the following in your config.ru:
RJack::Logback.configure do
RJack::Logback.load_xml_config( 'sample-logback.xml' )
end
rackup launcher
See fishwife/example/config.ru for an example that works with rackup. When using rackup [-s Fishwife]
, no SLF4J output adaptor is loaded at all. You can arrange for any of these yourself.
Finally, see the logging section of the fishwife/README. Might consider this thread source material to be later integrated in the README which definitely has room for improvement.
from fishwife.
Thanks for the very detailed response. This is very helpful.
from fishwife.
Referenced in README given the useful question and notes here.
from fishwife.
Related Issues (9)
- Rack 2.x support HOT 3
- Configuration of jetty? HOT 1
- Is async supported? HOT 6
- Silently fallback to WEBrick or panic: failed to coerce org.slf4j.helpers.NOPLoggerFactory to ch.qos.logback.core.Context HOT 10
- java.lang.NoSuchMethodError on Jruby 9.3.3.0 nightly build HOT 3
- rack.input does not rewind HOT 7
- fishwife and sinatra 1.4.x mangled content HOT 8
- :async in fishwife HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from fishwife.