You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cocoon.apache.org by Torsten Curdt <tc...@dff.st> on 2001/09/05 10:35:51 UTC

logging

I haven't had a look into the new improved logging managment yet
(I'm a bit behind the current CVS)

Is it now possibly to define different priorities (debug/warn/error)
to different child loggers or packages?

Thanks for a hint
--
Torsten

---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org


Context source

Posted by "Piroumian, Konstantin" <KP...@flagship.ru>.
Hi, all!

I am again bothering you with source resolution problems.

As I could get from ContextURLFactory implementation, the 'context://'
protocol is resolved as a resource source:

-- ContextURLFactory.java --
...
51.        URL u = envContext.getResource("/" + location);
...

This results in calling the HttpContext.getResource() (in case of servlet
environment). This is fine for static resources, such as images etc., but it
cannot be used for obtaining a dynamic content, such as a response from a
JSP page. (This is also mentioned in Servlet 2.3 specification).

For whatever reason the returned value is a system dependent path, and more
over (although, I'm not sure about this), but it seems that the format is
incorrect. Example:

...
String contextDir = new
File(httpContext.getRealPath("/")).toURL().toExternalForm();
System.out.println("--> context path: " + contextDir);

String source = "context://jsp/index.jsp";
System.out.println("--> original source: " + source);

Source src = this.resolver.resolve(this.source);
System.out.println("--> resloved to " + src.getSystemId());
...

Output:
--> context path: file:/D:/tomcat/webapps/cocoon2/
--> original source:  context://jsp/welcome.jsp
--> resloved to: file:D:\tomcat\webapps\cocoon2\jsp\welcome.jsp

As you can see: file:D:\tomcat\webapps\cocoon2\jsp\welcome.jsp - is a system
dependent path and there is no a leading '/' (or '\') before the drive name
(compare with the context path).

Are there any hints/comments/suggestions about this behavior? Of course, I
can anylise the protocol myself, strip 'file:' part, append a '\', etc., but
it's not the correct way, isn't it? I think, that the result of source
resolution must be a correct system independent URL, or I am wrong?

Thanks for any opinions.

Regards,
    Konstantin Piroumian



---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org


RE: logging

Posted by Torsten Curdt <tc...@dff.st>.
> > I haven't had a look into the new improved logging managment yet
> > (I'm a bit behind the current CVS)
> > 
> > Is it now possibly to define different priorities (debug/warn/error)
> > to different child loggers or packages?
> > 
> > Thanks for a hint
> 
> Yup! Have a look at the docs in avalon-excalibur about it.

Wow! Even docs already - I need to catch up again a little ;)
Thanks!
--
Torsten

---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org


Re: logging

Posted by Giacomo Pati <gi...@apache.org>.
Quoting Torsten Curdt <tc...@dff.st>:

> I haven't had a look into the new improved logging managment yet
> (I'm a bit behind the current CVS)
> 
> Is it now possibly to define different priorities (debug/warn/error)
> to different child loggers or packages?
> 
> Thanks for a hint

Yup! Have a look at the docs in avalon-excalibur about it.

Giacomo

> --
> Torsten
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
> For additional commands, email: cocoon-dev-help@xml.apache.org
> 
> 
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org