質問

There is an exception thrown and logged by the EJB container before I can handle it in my code (catch-block), so I decided to filter it. So, I am trying to create a weblogic log filters like explained here

Everything works fine as long as my filter looks like this:

NOT(MESSAGE LIKE '%java.sql.SQLIntegrityConstraintViolationException%')

But when i try to specify it more, for example which unique constraint I want to filter it is not filtering anything.

For example, I tried both:

NOT(MESSAGE LIKE '%ORA-00001: unique constraint (SOME.UQ_MY_CONSTRAINT violated%')

and

 NOT(MESSAGE LIKE '%java.sql.SQLIntegrityConstraintViolationException: ORA-00001: unique constraint (SOME.UQ_MY_CONSTRAINT) violated%')

Even when I try to escape the special characters these messages continue to show in the log.

Here is the Oracle configurational tutorial

役に立ちましたか?

解決

In the oracle documentation it is said

...A backslash character (\) can be used to escape special characters, such as a quote (`) or a percent character (%)...

But they are not giving full list of the special characters (or at least I couldn't find it)

The problem here was very simple - I was not escaping the brackets - ( and ). So, the log filter should look like this:

NOT(MESSAGE LIKE '%java.sql.SQLIntegrityConstraintViolationException: ORA-00001: unique constraint \(SOME.UQ_MY_CONSTRAINT\) violated%')
ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top