You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomee.apache.org by Karan Malhi <ka...@gmail.com> on 2007/08/22 22:40:47 UTC

Re: [jira] Updated: (OPENEJB-669) remove hsql log messages from server startup

I have been able to clean it up. Basically the way Hsql Server is
coded is a little different. Some setters and getters on invocation
print to the console before the fields are actually assigned a value.
For example, hsql Server has a boolean property called silent, here is
how it is set

public boolean setSilent(boolean silent){
   // print to console that this method was called
   // do some stuff
   this.silent = silent;
}
So you can see that even if i ask hsql to remain silent, it will still
not really remain silent. It will atleast print that the method
setSilent was called.

Okay, so here is another property of type PrintWriter called
logWriter. If I set it to null, then we do not see *all* of the
messages on the console but we do see one , which is something like

[Server@5e9d7a]: [Thread[HSQLDB Server @5e9d7a,5,main]]: run()/openDatabases():

This is because one of the methods calls another method called
printError which prints to the console. It uses a
PrintWriter errWriter ;

Here is a dirty solution which can be improved upon, but we need to
have some discussion on setting up configurable properties for hsql.
We will pretty much lose hsql logs using this solution. I think we
should still be able to see traces of JDBC messages.

I have hard-coded the setLogWriter and setErrWriter to null and set
the slient property to true. This way we will not see any messages.
However, we should really be setting these properties from
server.properties file which hsql requires.

On 8/22/07, karan singh malhi (JIRA) <ji...@apache.org> wrote:
>
>      [ https://issues.apache.org/jira/browse/OPENEJB-669?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
>
> karan singh malhi updated OPENEJB-669:
> --------------------------------------
>
>     Attachment: openejb-669.patch
>
> Added patch. Set logwriter, errWriter to null and setSilent to true
>
> > remove hsql log messages from server startup
> > --------------------------------------------
> >
> >                 Key: OPENEJB-669
> >                 URL: https://issues.apache.org/jira/browse/OPENEJB-669
> >             Project: OpenEJB
> >          Issue Type: Improvement
> >          Components: server
> >            Reporter: karan singh malhi
> >         Attachments: openejb-669.patch
> >
> >
> > When openejb server starts, HSQL dirties the console output with its own log messages. Remove those messages
>
> --
> This message is automatically generated by JIRA.
> -
> You can reply to this email to add a comment to the issue online.
>
>


-- 
Karan Singh Malhi

Re: [jira] Updated: (OPENEJB-669) remove hsql log messages from server startup

Posted by Karan Malhi <ka...@gmail.com>.
I think it is totally doable and a great idea!! . Will work on it tonight

On 8/22/07, David Blevins <da...@visi.com> wrote:
> Is there some way to maybe wrap a PrintWriter around Logger.info(...)
> and set it on setLogWriter then do the same for a PrintWriter around
> Logger.error(...) for setErrWriter?  I know I tried something similar
> with Castor once.  Think it's Log4jPrintWriter in the utils package.
>
> Would that allow us to still get the hsql messages, but ensure they
> go to log4j?
>
> -David
>
> On Aug 22, 2007, at 1:40 PM, Karan Malhi wrote:
>
> > I have been able to clean it up. Basically the way Hsql Server is
> > coded is a little different. Some setters and getters on invocation
> > print to the console before the fields are actually assigned a value.
> > For example, hsql Server has a boolean property called silent, here is
> > how it is set
> >
> > public boolean setSilent(boolean silent){
> >    // print to console that this method was called
> >    // do some stuff
> >    this.silent = silent;
> > }
> > So you can see that even if i ask hsql to remain silent, it will still
> > not really remain silent. It will atleast print that the method
> > setSilent was called.
> >
> > Okay, so here is another property of type PrintWriter called
> > logWriter. If I set it to null, then we do not see *all* of the
> > messages on the console but we do see one , which is something like
> >
> > [Server@5e9d7a]: [Thread[HSQLDB Server @5e9d7a,5,main]]: run()/
> > openDatabases():
> >
> > This is because one of the methods calls another method called
> > printError which prints to the console. It uses a
> > PrintWriter errWriter ;
> >
> > Here is a dirty solution which can be improved upon, but we need to
> > have some discussion on setting up configurable properties for hsql.
> > We will pretty much lose hsql logs using this solution. I think we
> > should still be able to see traces of JDBC messages.
> >
> > I have hard-coded the setLogWriter and setErrWriter to null and set
> > the slient property to true. This way we will not see any messages.
> > However, we should really be setting these properties from
> > server.properties file which hsql requires.
> >
> > On 8/22/07, karan singh malhi (JIRA) <ji...@apache.org> wrote:
> >>
> >>      [ https://issues.apache.org/jira/browse/OPENEJB-669?
> >> page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
> >>
> >> karan singh malhi updated OPENEJB-669:
> >> --------------------------------------
> >>
> >>     Attachment: openejb-669.patch
> >>
> >> Added patch. Set logwriter, errWriter to null and setSilent to true
> >>
> >>> remove hsql log messages from server startup
> >>> --------------------------------------------
> >>>
> >>>                 Key: OPENEJB-669
> >>>                 URL: https://issues.apache.org/jira/browse/
> >>> OPENEJB-669
> >>>             Project: OpenEJB
> >>>          Issue Type: Improvement
> >>>          Components: server
> >>>            Reporter: karan singh malhi
> >>>         Attachments: openejb-669.patch
> >>>
> >>>
> >>> When openejb server starts, HSQL dirties the console output with
> >>> its own log messages. Remove those messages
> >>
> >> --
> >> This message is automatically generated by JIRA.
> >> -
> >> You can reply to this email to add a comment to the issue online.
> >>
> >>
> >
> >
> > --
> > Karan Singh Malhi
> >
>
>


-- 
Karan Singh Malhi

Re: [jira] Updated: (OPENEJB-669) remove hsql log messages from server startup

Posted by David Blevins <da...@visi.com>.
Is there some way to maybe wrap a PrintWriter around Logger.info(...)  
and set it on setLogWriter then do the same for a PrintWriter around  
Logger.error(...) for setErrWriter?  I know I tried something similar  
with Castor once.  Think it's Log4jPrintWriter in the utils package.

Would that allow us to still get the hsql messages, but ensure they  
go to log4j?

-David

On Aug 22, 2007, at 1:40 PM, Karan Malhi wrote:

> I have been able to clean it up. Basically the way Hsql Server is
> coded is a little different. Some setters and getters on invocation
> print to the console before the fields are actually assigned a value.
> For example, hsql Server has a boolean property called silent, here is
> how it is set
>
> public boolean setSilent(boolean silent){
>    // print to console that this method was called
>    // do some stuff
>    this.silent = silent;
> }
> So you can see that even if i ask hsql to remain silent, it will still
> not really remain silent. It will atleast print that the method
> setSilent was called.
>
> Okay, so here is another property of type PrintWriter called
> logWriter. If I set it to null, then we do not see *all* of the
> messages on the console but we do see one , which is something like
>
> [Server@5e9d7a]: [Thread[HSQLDB Server @5e9d7a,5,main]]: run()/ 
> openDatabases():
>
> This is because one of the methods calls another method called
> printError which prints to the console. It uses a
> PrintWriter errWriter ;
>
> Here is a dirty solution which can be improved upon, but we need to
> have some discussion on setting up configurable properties for hsql.
> We will pretty much lose hsql logs using this solution. I think we
> should still be able to see traces of JDBC messages.
>
> I have hard-coded the setLogWriter and setErrWriter to null and set
> the slient property to true. This way we will not see any messages.
> However, we should really be setting these properties from
> server.properties file which hsql requires.
>
> On 8/22/07, karan singh malhi (JIRA) <ji...@apache.org> wrote:
>>
>>      [ https://issues.apache.org/jira/browse/OPENEJB-669? 
>> page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
>>
>> karan singh malhi updated OPENEJB-669:
>> --------------------------------------
>>
>>     Attachment: openejb-669.patch
>>
>> Added patch. Set logwriter, errWriter to null and setSilent to true
>>
>>> remove hsql log messages from server startup
>>> --------------------------------------------
>>>
>>>                 Key: OPENEJB-669
>>>                 URL: https://issues.apache.org/jira/browse/ 
>>> OPENEJB-669
>>>             Project: OpenEJB
>>>          Issue Type: Improvement
>>>          Components: server
>>>            Reporter: karan singh malhi
>>>         Attachments: openejb-669.patch
>>>
>>>
>>> When openejb server starts, HSQL dirties the console output with  
>>> its own log messages. Remove those messages
>>
>> --
>> This message is automatically generated by JIRA.
>> -
>> You can reply to this email to add a comment to the issue online.
>>
>>
>
>
> -- 
> Karan Singh Malhi
>