You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4j-user@logging.apache.org by Emi Lu <em...@encs.concordia.ca> on 2015/06/29 16:45:16 UTC

Hide *.jar

Hello List,

May I know how to hide the following *.jar info please?

     at 
org.hibernate.exception.internal.SQLStateConversionDelegate.convert(SQLStateConversionDelegate.java:123) 
~[hibernate-core-4.3.8.Final.jar:4.3.8.Final]
     at 
org.hibernate.exception.internal.StandardSQLExceptionConverter.convert(StandardSQLExceptionConverter.java:49) 
~[hibernate-core-4.3.8.Final.jar:4.3.8.Final]
     at 
org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:126) 
~[hibernate-core-4.3.8.Final.jar:4.3.8.Final]
     at 
org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:112) 
~[hibernate-core-4.3.8.Final.jar:4.3.8.Final]
     at 
org.hibernate.engine.jdbc.internal.ResultSetReturnImpl.extract(ResultSetReturnImpl.java:91) 
~[hibernate-core-4.3.8.Final.jar:4.3.8.Final]
     at org.hibernate.loader.Loader.getResultSet(Loader.java:2066) 
~[hibernate-core-4.3.8.Final.jar:4.3.8.Final]
     at 
org.hibernate.loader.Loader.executeQueryStatement(Loader.java:1863) 
~[hibernate-core-4.3.8.Final.jar:4.3.8.Final]
     at 
org.hibernate.loader.Loader.executeQueryStatement(Loader.java:1839) 
~[hibernate-core-4.3.8.Final.jar:4.3.8.Final]
     at org.hibernate.loader.Loader.doQuery(Loader.java:910) 
~[hibernate-core-4.3.8.Final.jar:4.3.8.Final]
     at 
org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:355) 
~[hibernate-core-4.3.8.Final.jar:4.3.8.Final]
     at org.hibernate.loader.Loader.doList(Loader.java:2554) 
~[hibernate-core-4.3.8.Final.jar:4.3.8.Final]
     at org.hibernate.loader.Loader.doList(Loader.java:2540) 
~[hibernate-core-4.3.8.Final.jar:4.3.8.Final]

Tried:
    <Logger name="org.hibernate"     level="FATAL" additivity="false">
       <AppenderRef ref="sql_log"    />
    </Logger>

But they are still shown in log file.

Thanks a lot!


---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-user-help@logging.apache.org


Re: Hide *.jar

Posted by Gary Gregory <ga...@gmail.com>.
Some possible alternatives:

Are you sure you do not want to simply turn off logging from a specific
logger.

You could also not log the source of stack frame at all. This would apply
to all stack traces if you do this in the pattern.

Gary

On Mon, Jun 29, 2015 at 8:45 AM, Emi Lu <em...@encs.concordia.ca> wrote:

>
>  This is an excerpt from a stack trace.
>>
>> Assuming it is coming from a log message (you don’t actually have enough
>> below to know for sure), then to filter specific packages from the stack
>> trace you would need to use the filters keyword on the rEx or xEx
>> converters in the PatternLayout.  If you simply don’t want to see
>> exceptions from hibernate then you need to look at the class that is
>> logging them and filter that.
>>
> Tried:
> <RegexFilter regex="org.hibernate.*" onMatch="DENY" onMismatch="ACCEPT" />
>
> But did not work. Do you have an example?
>
> Thanks a lot!
>
>> to hide the following *.jar info?
>>
>>     at
>> org.hibernate.exception.internal.SQLStateConversionDelegate.convert(SQLStateConversionDelegate.java:123)
>> ~[hibernate-core-4.3.8.Final.jar:4.3.8.Final]
>>     at
>> org.hibernate.exception.internal.StandardSQLExceptionConverter.convert(StandardSQLExceptionConverter.java:49)
>> ~[hibernate-core-4.3.8.Final.jar:4.3.8.Final]
>>     at
>> org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:126)
>> ~[hibernate-core-4.3.8.Final.jar:4.3.8.Final]
>>     at
>> org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:112)
>> ~[hibernate-core-4.3.8.Final.jar:4.3.8.Final]
>>     at
>> org.hibernate.engine.jdbc.internal.ResultSetReturnImpl.extract(ResultSetReturnImpl.java:91)
>> ~[hibernate-core-4.3.8.Final.jar:4.3.8.Final]
>>     at org.hibernate.loader.Loader.getResultSet(Loader.java:2066)
>> ~[hibernate-core-4.3.8.Final.jar:4.3.8.Final]
>>     at
>> org.hibernate.loader.Loader.executeQueryStatement(Loader.java:1863)
>> ~[hibernate-core-4.3.8.Final.jar:4.3.8.Final]
>>     at
>> org.hibernate.loader.Loader.executeQueryStatement(Loader.java:1839)
>> ~[hibernate-core-4.3.8.Final.jar:4.3.8.Final]
>>     at org.hibernate.loader.Loader.doQuery(Loader.java:910)
>> ~[hibernate-core-4.3.8.Final.jar:4.3.8.Final]
>>     at
>> org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:355)
>> ~[hibernate-core-4.3.8.Final.jar:4.3.8.Final]
>>     at org.hibernate.loader.Loader.doList(Loader.java:2554)
>> ~[hibernate-core-4.3.8.Final.jar:4.3.8.Final]
>>     at org.hibernate.loader.Loader.doList(Loader.java:2540)
>> ~[hibernate-core-4.3.8.Final.jar:4.3.8.Final]
>>
>> Tried:
>>    <Logger name="org.hibernate"     level="FATAL" additivity="false">
>>       <AppenderRef ref="sql_log"    />
>>    </Logger>
>>
>> But they are still shown in log file.
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
> For additional commands, e-mail: log4j-user-help@logging.apache.org
>
>


-- 
E-Mail: garydgregory@gmail.com | ggregory@apache.org
Java Persistence with Hibernate, Second Edition
<http://www.manning.com/bauer3/>
JUnit in Action, Second Edition <http://www.manning.com/tahchiev/>
Spring Batch in Action <http://www.manning.com/templier/>
Blog: http://garygregory.wordpress.com
Home: http://garygregory.com/
Tweet! http://twitter.com/GaryGregory

Re: Hide *.jar

Posted by Ralph Goers <ra...@dslextreme.com>.
Can you post the full output of the log event?

Ralph

> On Jun 29, 2015, at 8:45 AM, Emi Lu <em...@encs.concordia.ca> wrote:
> 
> 
>> This is an excerpt from a stack trace.
>> 
>> Assuming it is coming from a log message (you don’t actually have enough below to know for sure), then to filter specific packages from the stack trace you would need to use the filters keyword on the rEx or xEx converters in the PatternLayout.  If you simply don’t want to see exceptions from hibernate then you need to look at the class that is logging them and filter that.
> Tried:
> <RegexFilter regex="org.hibernate.*" onMatch="DENY" onMismatch="ACCEPT" />
> 
> But did not work. Do you have an example?
> 
> Thanks a lot!
>> to hide the following *.jar info?
>> 
>>    at org.hibernate.exception.internal.SQLStateConversionDelegate.convert(SQLStateConversionDelegate.java:123) ~[hibernate-core-4.3.8.Final.jar:4.3.8.Final]
>>    at org.hibernate.exception.internal.StandardSQLExceptionConverter.convert(StandardSQLExceptionConverter.java:49) ~[hibernate-core-4.3.8.Final.jar:4.3.8.Final]
>>    at org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:126) ~[hibernate-core-4.3.8.Final.jar:4.3.8.Final]
>>    at org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:112) ~[hibernate-core-4.3.8.Final.jar:4.3.8.Final]
>>    at org.hibernate.engine.jdbc.internal.ResultSetReturnImpl.extract(ResultSetReturnImpl.java:91) ~[hibernate-core-4.3.8.Final.jar:4.3.8.Final]
>>    at org.hibernate.loader.Loader.getResultSet(Loader.java:2066) ~[hibernate-core-4.3.8.Final.jar:4.3.8.Final]
>>    at org.hibernate.loader.Loader.executeQueryStatement(Loader.java:1863) ~[hibernate-core-4.3.8.Final.jar:4.3.8.Final]
>>    at org.hibernate.loader.Loader.executeQueryStatement(Loader.java:1839) ~[hibernate-core-4.3.8.Final.jar:4.3.8.Final]
>>    at org.hibernate.loader.Loader.doQuery(Loader.java:910) ~[hibernate-core-4.3.8.Final.jar:4.3.8.Final]
>>    at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:355) ~[hibernate-core-4.3.8.Final.jar:4.3.8.Final]
>>    at org.hibernate.loader.Loader.doList(Loader.java:2554) ~[hibernate-core-4.3.8.Final.jar:4.3.8.Final]
>>    at org.hibernate.loader.Loader.doList(Loader.java:2540) ~[hibernate-core-4.3.8.Final.jar:4.3.8.Final]
>> 
>> Tried:
>>   <Logger name="org.hibernate"     level="FATAL" additivity="false">
>>      <AppenderRef ref="sql_log"    />
>>   </Logger>
>> 
>> But they are still shown in log file.
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
> For additional commands, e-mail: log4j-user-help@logging.apache.org
> 



---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-user-help@logging.apache.org


Re: Hide *.jar

Posted by Emi Lu <em...@encs.concordia.ca>.
> This is an excerpt from a stack trace.
>
> Assuming it is coming from a log message (you don’t actually have enough below to know for sure), then to filter specific packages from the stack trace you would need to use the filters keyword on the rEx or xEx converters in the PatternLayout.  If you simply don’t want to see exceptions from hibernate then you need to look at the class that is logging them and filter that.
Tried:
<RegexFilter regex="org.hibernate.*" onMatch="DENY" onMismatch="ACCEPT" />

But did not work. Do you have an example?

Thanks a lot!
> to hide the following *.jar info?
>
>     at org.hibernate.exception.internal.SQLStateConversionDelegate.convert(SQLStateConversionDelegate.java:123) ~[hibernate-core-4.3.8.Final.jar:4.3.8.Final]
>     at org.hibernate.exception.internal.StandardSQLExceptionConverter.convert(StandardSQLExceptionConverter.java:49) ~[hibernate-core-4.3.8.Final.jar:4.3.8.Final]
>     at org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:126) ~[hibernate-core-4.3.8.Final.jar:4.3.8.Final]
>     at org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:112) ~[hibernate-core-4.3.8.Final.jar:4.3.8.Final]
>     at org.hibernate.engine.jdbc.internal.ResultSetReturnImpl.extract(ResultSetReturnImpl.java:91) ~[hibernate-core-4.3.8.Final.jar:4.3.8.Final]
>     at org.hibernate.loader.Loader.getResultSet(Loader.java:2066) ~[hibernate-core-4.3.8.Final.jar:4.3.8.Final]
>     at org.hibernate.loader.Loader.executeQueryStatement(Loader.java:1863) ~[hibernate-core-4.3.8.Final.jar:4.3.8.Final]
>     at org.hibernate.loader.Loader.executeQueryStatement(Loader.java:1839) ~[hibernate-core-4.3.8.Final.jar:4.3.8.Final]
>     at org.hibernate.loader.Loader.doQuery(Loader.java:910) ~[hibernate-core-4.3.8.Final.jar:4.3.8.Final]
>     at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:355) ~[hibernate-core-4.3.8.Final.jar:4.3.8.Final]
>     at org.hibernate.loader.Loader.doList(Loader.java:2554) ~[hibernate-core-4.3.8.Final.jar:4.3.8.Final]
>     at org.hibernate.loader.Loader.doList(Loader.java:2540) ~[hibernate-core-4.3.8.Final.jar:4.3.8.Final]
>
> Tried:
>    <Logger name="org.hibernate"     level="FATAL" additivity="false">
>       <AppenderRef ref="sql_log"    />
>    </Logger>
>
> But they are still shown in log file.


---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-user-help@logging.apache.org


Re: Hide *.jar

Posted by Ralph Goers <ra...@dslextreme.com>.
This is an excerpt from a stack trace. 

Assuming it is coming from a log message (you don’t actually have enough below to know for sure), then to filter specific packages from the stack trace you would need to use the filters keyword on the rEx or xEx converters in the PatternLayout.  If you simply don’t want to see exceptions from hibernate then you need to look at the class that is logging them and filter that.

Ralph

> On Jun 29, 2015, at 7:45 AM, Emi Lu <em...@encs.concordia.ca> wrote:
> 
> Hello List,
> 
> May I know how to hide the following *.jar info please?
> 
>    at org.hibernate.exception.internal.SQLStateConversionDelegate.convert(SQLStateConversionDelegate.java:123) ~[hibernate-core-4.3.8.Final.jar:4.3.8.Final]
>    at org.hibernate.exception.internal.StandardSQLExceptionConverter.convert(StandardSQLExceptionConverter.java:49) ~[hibernate-core-4.3.8.Final.jar:4.3.8.Final]
>    at org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:126) ~[hibernate-core-4.3.8.Final.jar:4.3.8.Final]
>    at org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:112) ~[hibernate-core-4.3.8.Final.jar:4.3.8.Final]
>    at org.hibernate.engine.jdbc.internal.ResultSetReturnImpl.extract(ResultSetReturnImpl.java:91) ~[hibernate-core-4.3.8.Final.jar:4.3.8.Final]
>    at org.hibernate.loader.Loader.getResultSet(Loader.java:2066) ~[hibernate-core-4.3.8.Final.jar:4.3.8.Final]
>    at org.hibernate.loader.Loader.executeQueryStatement(Loader.java:1863) ~[hibernate-core-4.3.8.Final.jar:4.3.8.Final]
>    at org.hibernate.loader.Loader.executeQueryStatement(Loader.java:1839) ~[hibernate-core-4.3.8.Final.jar:4.3.8.Final]
>    at org.hibernate.loader.Loader.doQuery(Loader.java:910) ~[hibernate-core-4.3.8.Final.jar:4.3.8.Final]
>    at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:355) ~[hibernate-core-4.3.8.Final.jar:4.3.8.Final]
>    at org.hibernate.loader.Loader.doList(Loader.java:2554) ~[hibernate-core-4.3.8.Final.jar:4.3.8.Final]
>    at org.hibernate.loader.Loader.doList(Loader.java:2540) ~[hibernate-core-4.3.8.Final.jar:4.3.8.Final]
> 
> Tried:
>   <Logger name="org.hibernate"     level="FATAL" additivity="false">
>      <AppenderRef ref="sql_log"    />
>   </Logger>
> 
> But they are still shown in log file.
> 
> Thanks a lot!
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
> For additional commands, e-mail: log4j-user-help@logging.apache.org
> 



---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-user-help@logging.apache.org