I am using slf4j with Java Util Logging, and my application logs are directed through Jetty.
How can I get separate output of Jetty startup logs and my application logs. Right now, they are both logged into the same file under jetty/logs.
How can I control the Jetty startup log format?
e.g. I want to change the date format from default "2012-09-13 14:55:36.178:INFO..." to "Sept 13, 2012 14:55:36.178:INFO..." in Jetty logs.
You can take a look at this page for inspiration:
http://wiki.eclipse.org/Jetty/Tutorial/Sifting_Logs_with_Logback
Long story short, once you have the slf4j-api in the mix then jetty turns logging over to it so you are able to configure whatever you want via slf4j configuration mechanisms.
Related
How using Clojurescript get logs in serverside. I am using taoensso.timbre for logging and some of those logs are displayed in browsers console. How to make logs appear on the machine where Leiningen process started. I am using Figwheel and wanting to push all the logs into servers console. Is there a possibility to do so?
Or maybe a browser supports that?
More than likely, you'll want to wrap the timbre logging functions. You can write a function with the same signature as your logger, and make it responsible for both local and remote logging. After using the vanilla logging to report to the javascript console, you'll want to make an async request with a library like https://github.com/JulianBirch/cljs-ajax to your logging service of choice.
I have a web application getting deployed on embedded jetty 9.2.3
I have tried externalising the logging libraries and config from the web app by doing the following:
placed slf4j, logback-classic and logback-core libs under lib/logging
placed logback.xml file under resources
However, this does not have the desired effect and the logs are appearing in the same manner as it was with default jetty configuration.
If I place logback.xml and the dependencies within the web app, the logs are appearing correctly.
Any suggestions will be appreciated.
I have a WAR deployed to Jetty 9.0.0.M3. I am trying to figure out what I need to set in my context in order to be able to have it reloaded every time I upload an updated war file (without having to restart Jetty).
I had a look at the docs, but I'm afraid I couldn't find what I was looking for. I only know how to do this with the embedded Jetty Maven plugin, but not with the standalone.
Any help would be appreciated! Thanks.
The key is in the deployer. You need to wire up the deployment manager functionality and have it manage the starting of the webapp.
http://git.eclipse.org/c/jetty/org.eclipse.jetty.project.git/tree/jetty-deploy/src/main/java/org/eclipse/jetty/deploy/providers/WebAppProvider.java
The jetty xml files are effectively a thin skin over java so look the following xml file which is what jetty uses for the traditional webapp startup of our distribution.
http://git.eclipse.org/c/jetty/org.eclipse.jetty.project.git/tree/jetty-deploy/src/main/config/etc/jetty-deploy.xml
This ought to get you fixed up.
I have created a c++ ATL web service in visual studio 2005. I want to have detailed logs for my web service as what request come or weather any exception happened during the Database call.
I am hosting my web service through IIS. I know that IIS create a log file if logging is enabled But i want to have some more control over those logs in terms of format.
Is there any method to use IIS system itself to implement our own logs inside that log file or
Should I implement a multithreaded logging system which will push logs to a text file.
Thanks
If you want logging beyond what IIS offers natively, you will either have to implement your own logger or make use of any of dozens of loggers already out there.
One that a lot of people love is Peantheios: http://www.pantheios.org/
There are many out there.
The simple answer to your question, though, is that IIS does not have built-in facilities for logging beyond what you see in the GUI.
I have a webapp (http://sourceforge.net/projects/sf-mvn-plugins/files/m2-repo/net/sf/maven/plugins/example-captaincasa-jnlp/0.1-SNAPSHOT/example-captaincasa-jnlp-0.1-SNAPSHOT.war/download) which uses jsf in a servlet container. This works fine with jetty-maven-plugin run-war target at my local pc. In the future I would like make more of this kind of webapps.
I am looking for a way to deliver these webapps with jetty via jnlp. The end user should be have a zero installation but the webapps needs servlet container and my hoster does not support a servlet container or application server or so on.
I don't like an embedded solution because in this case each webapp must be delivered with a separate jetty und run with a separate jetty -> too big size -> to many download size and so on.
The architecture should be similar to this:
(source: sourceforge.net)
Example: Bundle1 could contains jetty and deployed webapp1 and Bundle2 could contains jetty and deployed webapp1 and webapp2 (related to requirements of end user I would like deliver many variant of my webapps)
But what is my question?
Which jars of jetty are needed? I would like these upload to my homepage for hosting.
Which jar should I use for jetty as main jar to start him via jnlp?
Which main class should I use to start jetty via jnlp?
Which parameter could I use to configure jetty to say this is war of webapp1 and this is war of webapp2.... or this is directory of weapps for hot deployment...?
The important question for me is 1. If this is answered so that I could run jetty local (without maven plugin) and via manual maybe I could solve the rest 2-4.
Why not deploy a normal Java app (with a main() etc.) that invokes Jetty programatically via its Server class? That class is configured via code with the appropriate contexts, servlet classes etc.
I've done that before with success. The only headache is running one Jetty with multiple apps being downloaded on request (if I read your question correctly). Can you use some classloading magic, and load classes/apps on demand from a remote URL ?
I have found another way today. This is interesting too. Here is the concept:
Use java webstart to install an osgi container
Use a bundle x or a osgi service to download all bundles of your app
Use the jetty bundle to provide jetty support
Then the application is installed
I got the idea from this article:
http://www.toedter.com/blog/?p=45