Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1TvtCK-00044r-5c for pgsql-jdbc@arkaria.postgresql.org; Thu, 17 Jan 2013 17:24:17 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.72) (envelope-from ) id 1TvtCI-0000gH-Qw for pgsql-jdbc@arkaria.postgresql.org; Thu, 17 Jan 2013 17:24:14 +0000 Received: from makus.postgresql.org ([98.129.198.125]) by malur.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1TvtCI-0000gC-2g for pgsql-jdbc@postgresql.org; Thu, 17 Jan 2013 17:24:14 +0000 Received: from outbound.vnet-inc.com ([216.146.104.103]) by makus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1TvtCF-0003uy-Ld for pgsql-jdbc@postgresql.org; Thu, 17 Jan 2013 17:24:12 +0000 Received: from [192.168.157.132] (unknown [76.75.27.41]) by outbound.vnet-inc.com (Postfix) with ESMTP id 843525A20 for ; Thu, 17 Jan 2013 10:24:11 -0700 (MST) Message-ID: <50F8335B.6070404@ttc-cmc.net> Date: Thu, 17 Jan 2013 10:22:35 -0700 From: dmp User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.13) Gecko/20100914 SeaMonkey/2.0.8 MIME-Version: 1.0 To: pgsql-jdbc@postgresql.org Subject: Re: [BUGS]log can not be output when use DataSource Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Pg-Spam-Score: -1.9 (-) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-jdbc Precedence: bulk Sender: pgsql-jdbc-owner@postgresql.org Also is logLevel expected in the DriverManager.getConnection(getUrl(), user, password)? According to the API jdbc:subprotocol:subname is expected and many of the other parameters seem to not be optionally applied like loginTimeout, and socketTimeout like logLevel. I'm also not inclinded to understand how this is a bug and fails to not log, though may not report the parameter properly unless the user does setLogLevel(). danap. Dave Cramer wrote: > Yes, it might be better, but I don't see how it fails otherwise ? > > Dave Cramer > > dave.cramer(at)credativ(dot)ca > http://www.credativ.ca > > > On Thu, Jan 17, 2013 at 5:42 AM, Chen Huajun > wrote: > > > > It's early here but I can't see how this makes it work. It > appears that the code that is being replaced is exactly the same > except that there is an if statement in front of it ? > > > > > > org.postgresql.Driver.__setLogLevel(org.postgresql.__Driver.DEBUG); > > here the JVM level's LogLevel is set to be DEBUG. > > > > > DataSource source = (DataSource)new > InitialContext().lookup("__DataSource"); > > Connection con = source.getConnection(); > > source.getConnection() > -->DriverManager.__getConnection(getUrl(), user, password) > ->getUrl() > sb.append("&loglevel=").__append(logLevel); > > here the Connection's LogLevel is set to be the initial value 0(*) > via URL, > although nobody set DataSource's LogLevel by calling > BaseDataSource.setLogLevel(). > > I think it's better append "loglevel" to URL only when > BaseDataSource.setLogLevel() was called. > so a Connection created by DataSource.getConnection() can inherit > JVM level's LogLevel setting > just like which one created by DriverManager.getConnection(). > > > *)0 is the initial value and not a valid LogLevel, > valid values are INFO (1) and DEBUG (2). > > > -- > Best Regards, > Chen Huajun > (2013/01/17 17:19), Dave Cramer wrote: > > It's early here but I can't see how this makes it work. It > appears that the code that is being replaced is exactly the same > except that there is an if statement in front of it ? > > > > Dave Cramer > > dave.cramer(at)credativ(dot)ca > http://www.credativ.ca > > > On Wed, Jan 16, 2013 at 11:47 PM, Chen Huajun > > >__> > wrote: > > Hi, > > In the following code,log can not be output as expected. > > ------------------------------__------- > > org.postgresql.Driver.__setLogLevel(org.postgresql.__Driver.DEBUG); > DataSource source = (DataSource)new > InitialContext().lookup("__DataSource"); > Connection con = source.getConnection(); > ------------------------------__------- > > It's seems to be a problem, > I have made a small patch to fix it. > Hopefully this useful. > > -- > Best Regards, > Chen Huajun > -- > Sent via pgsql-jdbc mailing list (pgsql-jdbc@postgresql.org > > >) > > To make changes to your subscription: > http://www.postgresql.org/__mailpref/pgsql-jdbc > -- Sent via pgsql-jdbc mailing list (pgsql-jdbc@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-jdbc