I had a quick look at log4J, but though it looked very complete, also bit
more difficult to use that the dumb servlet.log()...
I could not download the binaries from opensymphony.

But I when I get some time, I will have a better look at log4j anyway.

thanks.

Olivier
-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]On Behalf Of Dan North
Sent: 11 April 2001 13:02
To: Orion-Interest
Subject: RE: Building an application


Logging is something that has been rather overlooked in java.  The proposed
Java 1.4 contains a logging api, but in the meantime, the log4j project at
jakarta.apache.org/log4j is an excellent framework suitable for most
architectures.  We use it all the time in servlets, EJBs, taglibs, etc and
it works very well.

The OpenSymphony open source project (www.opensymphony.com) contains a
class called com.opensymphony.util.Logger in oscore.jar (you can obtain and
build this through anonymous cvs) which conveniently hides all the things
you don't need to know about log4j.  You use it like this:

import com.opensymphony.util.Logger;

public class MyClass {
   private static final Logger logger = new Logger( MyClass.class );
   ...
   public void myMethod() {
     logger.debug( "This is a debug message" );
     logger.info( "This is info" );
     logger.warn( "Guess what this is?" );
     logger.error( "Bad news" );
     logger.fatal( "REALLY bad news" );
     ...


It reads in a properties file which is described in the log4j docs, and is
accessed by
the logger.config system property, eg:

java -Dlogger.config=/path/to/my/logger.properties MyClass

which allows you to switch logging on and off, and record only certain
priorities of logging, send debug to the console and error to syslog or the
Event Logger in NT, etc.

Very clean, simple and nice to use.

Hope that helps,
Dan/tastapod

ps. I have no commercial affiliation in opensymphony, but Logger is
possibly the class I use the most anywhere in java, after java.lang.String
:o)


At 10:09 11/04/2001 +0100, you wrote:
>Thanks everyone,
>
>Switching off the "friendly" message, help me figuring out.
>
>It is now working.
>I had to modify 3 config files (instead of 2...see at the bottom of this
>mail):
>application.xml:
>         <web-module id="taskforce" path="../applications/taskforce.ear" />
>default-web-site.xml
>         <web-app application="taskforce" name="taskforce"
root="/taskforce"/>
>server.xml
>         <application name="taskforce"
path="../applications/taskforce.ear"/>
>
>Does it look allright or redondant ???
>
>
>Is there a way to access a log class in Orion (is is standard to all EJB
>servers ?)
>
>Thanks again,
>
>Olivier
>
>-----Original Message-----
>From: [EMAIL PROTECTED]
>[mailto:[EMAIL PROTECTED]]On Behalf Of SCOTT FARQUHAR
>Sent: 11 April 2001 00:29
>To: Orion-Interest
>Subject: RE: Building an application
>
>
>Two things that might be of interest:
>
>         <!-- The default web-app for this site, bound to the root -->
>         <default-web-app application="default" name="defaultWebApp" />
>
>in default-web-site.xml .  I assume that you can map an application to root
>by changing that?
>
>Turn off "friendly error messages" in Internet Explorer
>(tools->options->advanced->show friendly http error messages).
>
>A 500 could mean anything.  Once you get the stack trace you might be able
>to determine what the problem is.
>
>Scott
>
>
> >>> [EMAIL PROTECTED] 04/11/01 04:21am >>>
>Dan,
>
>The error I have is 500 (http internal server error), when I type
>http://localhost/taskforce
>If I type http://localhost, I have the orion home page.
>
>This the tree of the applications directory, once expanded by orion.
>
>D:\JAVA\ORION\APPLICATIONS
>taskforce.ear
>\---taskforce
>         taskforce.war
>         userEJB.jar
>     +---META-INF
>         application.xml
>     \---taskforce
>         index.html
>         +---images
>         +---META-INF
>         \---WEB-INF
>             +---classes
>             |   +---net
>             |   |   \---tnt
>             |   |       +---user
>             |   |       |   \---model
>             |   |       +---util
>             |   |       \---web
>             |   |           +---control
>             |   |           \---taglib
>             |   \---org
>             |       \---apache
>             |           \---struts
>             |               \---resources
>             +---lib
>             \---tlds
>
>The server.xml and default-web-site.xml have been modified as mentionned at
>the bottom of this mail.
>
>I have tried to modify the context root to "/" but it did not change.
>
>I have just noticed that you can set the root="/taskforce" in
>default-web-site.xml
>         <web-app application="taskforce" name="taskforce-web"
> root="/taskforce"/>
>and also in the /META-INF/application.xml of you
>ear(<context-root>/taskforce</context>)
>
>I suppose they must be the same (which is the case for me). What is the
role
>of each ?
>
>I guess there are 2 possible source of error
>1) the way I have update the server.xml and default-web-site.xml
>         (default-web-site.xml)
>         <web-app application="taskforce" name="taskforceWebApp"
> root="/taskforce"/>
>
>         (server.xml)
>         <application name="taskforce" path="../applications/taskforce.ear"
/>
>
>2) the directory structure (see above)
>
>
>Thanks,
>
>Olivier
>-----Original Message-----
>From: [EMAIL PROTECTED]
>[mailto:[EMAIL PROTECTED]]On Behalf Of Daniel Lopez
>Sent: 10 April 2001 07:05
>To: Orion-Interest
>Subject: Re: Building an application
>
>
>Hi Oliver,
>Last week I was plating with the same thing and I was successful with
>pretty much the same configuration that you have, except that in
>application.xml I set the context root to /
>(<context-root>/</context-root>). Which error are you getting ? 404? Can
>you see your .ear file unpackaged?
>regards,
>Dan
>
> > olivier wrote:
> >
> > Hi,
> >
> > I am new to Orion, and I have recently been trying to build an
> > application (ear) with not much success. Basically, Orion seems to
> > deploys all the components, but I can't get the first page to open on
> > the browser.
> > I am using struts as a framework, with the fix I have seen on this
> > site (remove the dtd from the jar and put them under classes), and
> > struts does not seem to be the problem now (especially since my first
> > page is an index.html)
> >
> > The ear is in orion\applications
> >
> >     userEjb.jar
> >     taskforce.war
> >     \META-INF
> >         application.xml
> >
> > source of application.xml for the ear
> > <application>
> >   <display-name>taskforce</display-name>
> >   <description>Application description</description>
> >   <module>
> >     <web>
> >       <web-uri>taskforce.war</web-uri>
> >       <context-root>/taskforce</context-root>
> >     </web>
> >   </module>
> >   <module>
> >     <ejb>userEjb.jar</ejb>
> >   </module>
> > </application>
> >
> > I put this in default-web-site
> >  <web-app application="taskforce" name="taskforceWebApp"
> > root="/taskforce"/>
> > this in server.xml
> >  <application name="taskforce" path="../applications/taskforce.ear" />
> >
> >
> > I have tried with the news.ear coming with orion, but same problem.
> >
> > Any clue?
> >
> > Thanks,
> >
> > olivier

--
Dan North
VP Development  -  Cadrion Software Ltd  -  +44 (0)20 7440 9550

CONFIDENTIALITY
This e-mail and any attachments are confidential
and may also be privileged. If you are not the named recipient,
please notify the sender immediately and do not disclose the
contents to another person, use it for any purpose, or store
or copy the information in any medium



Reply via email to