You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomee.apache.org by Berner Martin <Ma...@qualitasag.ch> on 2020/04/20 15:53:33 UTC

CXF - Config - FaultListener

Hello, everyone,
I want to register my own FaultListener (org.apache.cxf.logging.FaultListener) for CXF to influence the logging behavior of the WebApplicationExceptionMapper.
What is the best way to do this within the web application.
Or alternatively to influence the logging of WebApplicationException. Especially to prevent them from ending up in catalina.out.

Thanks for any help.

AW: CXF - Config - FaultListener

Posted by Berner Martin <Ma...@qualitasag.ch>.
Hi,
Get it by myself. Register the Listener within the filter of a ContainerRequestFilter with high Prority:

@Provider
@Priority(Priorities.AUTHENTICATION - 1)
public class FaultListenerRgisterFilter implements ContainerRequestFilter {
	@Override
	public void filter(ContainerRequestContext containerRequestContext) throws IOException {
		PhaseInterceptorChain.getCurrentMessage().put(FaultListener.class.getName(), new ErrorObjectFaultListener());
	}
}

Gruss
Martin   

Softwareentwicklung & DBA
Qualitas AG

+41 41 768 92 12
Chamerstrasse 56
CH - 6300 Zug

qualitasag.ch
martin.berner@qualitasag.ch
-----Ursprüngliche Nachricht-----
Von: Berner Martin <Ma...@qualitasag.ch> 
Gesendet: Montag, 20. April 2020 17:54
An: users@tomee.apache.org
Betreff: CXF - Config - FaultListener

Hello, everyone,
I want to register my own FaultListener (org.apache.cxf.logging.FaultListener) for CXF to influence the logging behavior of the WebApplicationExceptionMapper.
What is the best way to do this within the web application.
Or alternatively to influence the logging of WebApplicationException. Especially to prevent them from ending up in catalina.out.

Thanks for any help.