Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jfQNs-0005GH-E2 for pljava-dev@arkaria.postgresql.org; Sun, 31 May 2020 16:00:24 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1jfQNp-0000K6-Bt for pljava-dev@arkaria.postgresql.org; Sun, 31 May 2020 16:00:21 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jfQNo-0000Jz-SR for pljava-dev@lists.postgresql.org; Sun, 31 May 2020 16:00:21 +0000 Received: from anastigmatix.net ([68.171.219.55]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jfQNh-0000Vv-1v for pljava-dev@lists.postgresql.org; Sun, 31 May 2020 16:00:20 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=anastigmatix.net; s=default; h=Content-Transfer-Encoding:Content-Type: In-Reply-To:MIME-Version:Date:Message-ID:From:Cc:References:To:Subject:Sender :Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=RFvqStgEVgkyO9Z5vrwrZoXImrx+3ebe9G3hTsYMCWI=; b=qex+rnYfJOM5bNdhswFmvUxmMH T/zf7H2nxI+Ft4OBFjljUCJooS81N5m7Yr8Hyn7xJUDEsAH09+iBJWSMG/ozXrQRoHtSFiht0HY1S +VihgN6YkaO3VrL3Wvlbaz0cq8pI/t8GiFIDZjuZOWujRToPo7wpjcIQ8UwfA6O2DiX6jQuep9DGL /EEzxb6Kb7nuw/L2leyO40H36D44ofro3cdUk6kQwK6dGtVl9Pa9hq4gSckOodFc233/PnhbHw+O+ KqqCrmQgEZ89vAYNiHevshuJdWcLCLYiI8vPLUCfYAXCNLFoIweJIh4rKl8ljc6sxwFgmZmwZ9MXd uvsYELfA==; Received: from [184.19.31.139] (port=54821) by bay.acenet.us with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.93) (envelope-from ) id 1jfQNd-00A9O0-B6; Sun, 31 May 2020 12:00:10 -0400 Subject: Re: Starting build-system work (Windows/Mac users please speak up) To: Kartik Ohri References: <5EC17E17.7070002@anastigmatix.net> <5ECED046.3000308@anastigmatix.net> <5ED0FCB0.405@anastigmatix.net> <5ED10C6D.2020000@anastigmatix.net> <5ED10F36.7060304@anastigmatix.net> <5ED15825.9060504@anastigmatix.net> <5ED270BA.9010001@anastigmatix.net> Cc: pljava-dev@lists.postgresql.org From: Chapman Flack X-Enigmail-Draft-Status: N1110 Message-ID: <5ED3D488.1010401@anastigmatix.net> Date: Sun, 31 May 2020 12:00:08 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.7.0 MIME-Version: 1.0 In-Reply-To: <5ED270BA.9010001@anastigmatix.net> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-OutGoing-Spam-Status: No, score=-95.0 X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - bay.acenet.us X-AntiAbuse: Original Domain - lists.postgresql.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - anastigmatix.net X-Get-Message-Sender-Via: bay.acenet.us: authenticated_id: chap@anastigmatix.net X-Authenticated-Sender: bay.acenet.us: chap@anastigmatix.net X-Source: X-Source-Args: X-Source-Dir: X-From-Rewrite: unmodified, already matched List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 05/30/20 10:42, Chapman Flack wrote: > Diagnostic messages from Java code generally follow one of these paths: > > - they get explicitly sent to PostgreSQL's elog system, and go wherever > the PostgreSQL logging is pointed, or suppressed depending on the > enabled log level > > - Java exceptions caught and turned into PostgreSQL errors go into the > PostgreSQL logs at level ERROR. > > - Separately, the stack traces of those exceptions are output if the > PostgreSQL log level is set to DEBUG1 or finer. The code adjusts > the vfprintf-hook log level (see below) to DEBUG1 before printing > the stack trace, but I'm not positive it isn't just going to System.err > and not through the hook. Should be easy enough to confirm, I just > haven't had to before. I've just confirmed this with gdb; an exception stack trace emitted with printStackTrace [0] goes straight to System.err and the vfprintf hook is not involved, so the surrounding calls to setJavaLogLevel aren't really accomplishing anything. > - Messages from the JVM itself that are emitted through a 'vfprintf hook' > are caught by PL/Java's hook [1] and injected into PostgreSQL's > elog system at a selectable level, usually INFO. (That is probably > the path being followed by the -Xcheck:jni messages, explaining > why they have INFO: in front.) Confirmed also: -Xcheck:jni messages go through the vfprintf hook, so they are always funneled into the PostgreSQL server log, regardless of the setting of logging_collector. > - Messages that are simply written to Java's System.err *can be* caught > and included in PostgreSQL's logs, depending on PostgreSQL's > logging_collector setting. [2] Otherwise, they just go wherever stderr > was pointing when the PostgreSQL server was started (or wherever > the server startup scripts point it). That could be, for example, > the systemd journal. -Chap [0] https://github.com/tada/pljava/blob/efbbc1d/pljava-so/src/main/c/JNICalls.c#L82 > [1] > https://github.com/tada/pljava/blob/efbbc1d/pljava-so/src/main/c/Backend.c#L200 > > [2] > https://www.postgresql.org/docs/9.5/runtime-config-logging.html#GUC-LOGGING-COLLECTOR