Codota Logo
Logger
Code IndexAdd Codota to your IDE (free)

How to use
Logger
in
org.postgresql.core

Best Java code snippets using org.postgresql.core.Logger (Showing top 20 results out of 315)

  • Common ways to obtain Logger
private void myMethod () {
Logger l =
  • Codota Iconnew Logger(nextConnectionID++)
  • Codota IconBaseConnection baseConnection;baseConnection.getLogger()
  • Smart code suggestions by Codota
}
origin: postgresql/postgresql

private SQLException receiveErrorMessage() throws IOException {
  String errorMsg = pgStream.ReceiveString().trim();
  if (logger.logDebug())
    logger.debug(" <=BE ErrorResponse(" + errorMsg + ")");
  return new PSQLException(errorMsg, PSQLState.UNKNOWN_STATE);
}
origin: postgresql/postgresql

private SQLWarning receiveNoticeResponse() throws IOException {
  int nlen = pgStream.ReceiveInteger4();
  ServerErrorMessage warnMsg = new ServerErrorMessage(pgStream.ReceiveString(nlen - 4), logger.getLogLevel());
  if (logger.logDebug())
    logger.debug(" <=BE NoticeResponse(" + warnMsg.toString() + ")");
  return new PSQLWarning(warnMsg);
}
origin: postgresql/postgresql

public void info(String str) {
  info(str, null);
}
origin: postgresql/postgresql

public void debug(String str, Throwable t) {
  if (logDebug())
    log(str, t);
}
origin: postgresql/postgresql

public void info(String str, Throwable t) {
  if (logInfo())
    log(str, t);
}
origin: postgresql/postgresql

  logger = new Logger(nextConnectionID++);
  logger.setLogLevel(logLevel);
if (logger.logInfo())
  logger.info(Driver.getVersion());
this.compatible = info.getProperty("compatible", Driver.MAJORVERSION + "." + Driver.MINORVERSION);
if (logger.logDebug())
  logger.debug("    compatible = " + compatible);
  logger.debug("    loglevel = " + logLevel);
  logger.debug("    prepare threshold = " + prepareThreshold);
origin: postgresql/postgresql

if (logger.logDebug())
  logger.debug("Trying to establish a protocol version 3 connection to " + host + ":" + port);
    logger.info("Couldn't parse socketTimeout value:" + socketTimeoutProperty);
  if (logger.logDebug())
    logger.debug("Protocol not supported, abandoning connection.");
  try
origin: postgresql/postgresql

/**** XAConnection interface ****/
public Connection getConnection() throws SQLException
{
  if (logger.logDebug())
    debug("PGXAConnection.getConnection called");
  Connection conn = super.getConnection();
  // When we're outside an XA transaction, autocommit
  // is supposed to be true, per usual JDBC convention.
  // When an XA transaction is in progress, it should be
  // false.
  if(state == STATE_IDLE)
    conn.setAutoCommit(true);
  /*
   * Wrap the connection in a proxy to forbid application from
   * fiddling with transaction state directly during an XA transaction
   */
  ConnectionHandler handler = new ConnectionHandler(conn);
  return (Connection)Proxy.newProxyInstance(getClass().getClassLoader(), new Class[]{Connection.class, PGConnection.class}, handler);
}
origin: postgresql/postgresql

public void debug(String str) {
  debug(str, null);
}
origin: postgresql/postgresql

protected void finalize() throws Throwable
{
  if (openStackTrace != null)
    logger.log(GT.tr("Finalizing a Connection that was never closed:"), openStackTrace);
  close();
}
origin: postgresql/postgresql

public static int getLogLevel()
{
  synchronized (Driver.class) {
    return logger.getLogLevel();
  }
}
origin: postgresql/postgresql

/**
* used to turn logging on to a certain level, can be called
* by specifying fully qualified class ie org.postgresql.Driver.setLogLevel()
* @param logLevel sets the level which logging will respond to
* INFO being almost no messages
* DEBUG most verbose
*/
public static void setLogLevel(int logLevel)
{
  synchronized (Driver.class) {
    logger.setLogLevel(logLevel);
    logLevelSet = true;
  }
}
origin: org.ancoron.postgresql/org.postgresql.osgi

  logger = new Logger(nextConnectionID++);
  logger.setLogLevel(logLevel);
if (logger.logInfo())
  logger.info(Driver.getVersion());
this.compatible = info.getProperty("compatible", Driver.MAJORVERSION + "." + Driver.MINORVERSION);
if (logger.logDebug())
  logger.debug("    compatible = " + compatible);
  logger.debug("    loglevel = " + logLevel);
  logger.debug("    prepare threshold = " + prepareThreshold);
origin: postgresql/postgresql

if (logger.logDebug())
  logger.debug("Trying to establish a protocol version 2 connection to " + host + ":" + port);
    logger.info("Couldn't parse socketTimeout value:" + socketTimeoutProperty);
origin: org.ancoron.postgresql/org.postgresql.osgi

public void debug(String str, Throwable t) {
  if (logDebug())
    log(str, t);
}
origin: org.ancoron.postgresql/org.postgresql.osgi

public void info(String str, Throwable t) {
  if (logInfo())
    log(str, t);
}
origin: postgresql/postgresql

public void commit(Xid xid, boolean onePhase) throws XAException {
  if (logger.logDebug())
    debug("committing xid = " + xid + (onePhase ? " (one phase) " : " (two phase)"));
  if (xid == null)
    throw new PGXAException(GT.tr("xid must not be null"), XAException.XAER_INVAL);
  if (onePhase)
    commitOnePhase(xid);
  else
    commitPrepared(xid);
}
origin: postgresql/postgresql

private void debug(String s) {
  logger.debug("XAResource " + Integer.toHexString(this.hashCode()) + ": " + s);
}
origin: org.ancoron.postgresql/org.postgresql.osgi

protected void finalize() throws Throwable
{
  if (openStackTrace != null)
    logger.log(GT.tr("Finalizing a Connection that was never closed:"), openStackTrace);
  close();
}
origin: org.ancoron.postgresql/org.postgresql

public static int getLogLevel()
{
  synchronized (Driver.class) {
    return logger.getLogLevel();
  }
}
org.postgresql.coreLogger

Javadoc

Poor man's logging infrastructure. This just deals with maintaining a per- connection ID and log level, and timestamping output.

Most used methods

  • <init>
  • debug
  • getLogLevel
  • info
  • log
  • logDebug
  • logInfo
  • setLogLevel

Popular in Java

  • Updating database using SQL prepared statement
  • getSupportFragmentManager (FragmentActivity)
  • setScale (BigDecimal)
    Returns a BigDecimal whose scale is the specified value, and whose value is numerically equal to thi
  • setContentView (Activity)
  • Kernel (java.awt.image)
  • System (java.lang)
    Provides access to system-related information and resources including standard input and output. Ena
  • Collections (java.util)
    This class consists exclusively of static methods that operate on or return collections. It contains
  • ThreadPoolExecutor (java.util.concurrent)
    An ExecutorService that executes each submitted task using one of possibly several pooled threads, n
  • Stream (java.util.stream)
    A sequence of elements supporting sequential and parallel aggregate operations. The following exampl
  • DateTimeFormat (org.joda.time.format)
    Factory that creates instances of DateTimeFormatter from patterns and styles. Datetime formatting i
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now