You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Nicolas Gillet <ni...@market-ip.com> on 2013/10/17 17:22:43 UTC

An annoying little log

Hi list,

Working with Tapestry 5.3.7 and Taptesty-spring-security 4.0.0 we have an annoying stack trace logged when a not-authenticated user tries to access a restricted page.
In that use case an exception is thrown which is perfectly normal. ("org.springframework.security.access.AccessDeniedException: Access is denied")
But an evil logger writes it while we just want to let it raise up to be properly caught and handled later, which TSS does.

The incriminated class is
org.apache.tapestry5.internal.services.RenderQueueImpl

In the run methods there is a catch :
catch (RuntimeException ex)
        {
            String message = ServicesMessages.renderQueueError(command, ex);

            logger.error(message, ex);

            throw new RenderQueueException(message, renderingComponents.getSnapshot(), ex);
        }
And there you can see that naughty logger printing the error.
This is not a good thing to me to log errors like that if you just wrap and re-throw them.

I think it should be good to simply remove the log line but someone will probably find this arguable so, for now I am just looking for a nice way to remove the log or at least silence it.
I know that T5 has powerful services override mechanism but I don't know to put it at work nor it can help me out here.

Any suggestion ?

Regards

Nicolas GILLET


Market-IP - Creating Mobile Intelligence
Phone : +32 81 33 11 11
Fax : +32 81 33 11 10
www.market-ip.com<http://www.market-ip.com/> - www.telefleet.com<http://www.telefleet.com/> - www.geoplanning.net<http://www.geoplanning.net/> - www.drivexpert.net<http://www.drivexpert.net/>
[Description : cid:image003.png@01CD5521.849F3340]<http://www.linkedin.com/groups/MarketIP-4289716?gid=4289716&trk=hb_side_g>