If I use the standard ORACLE.SQL ddl file, I get 0 rows/data logged into the backend.
But if I modify the standard Oracle.sql I get logged yet incomplete rows :
Below is the data from the 3 Oracle tables after Logback'ing 8 logs w/ the simplified Oracle.sql ddl. Any other columns not listed are NULL.
0 rows in table LOGGING_EVENT_EXCEPTION
8 rows in table LOGGING_EVENT
TIMESTMP REFERENCE_FLAG EVENT_ID
1.38988E+12 1 1006
1.38988E+12 1 1010
1.38988E+12 1 1012
1.38988E+12 1 1016
1.38988E+12 1 1018
1.38988E+12 1 1004
1.38988E+12 1 1008
1.38988E+12 1 1014
8 rows in table LOGGING_EVENT_PROPERTY
EVENT_ID
1006
1010
1012
1016
1018
1004
1008
1014
I modified the ORACLE.SQL ddl and removed all primary/foreign keys. I also made all columns NULL. These modifications insure that there is no balking/refusal on the backend side. It ensures that all data will be logged regardless of primary/foreign key data integrity:
create sequence LOGGING_EVENT_ID_SEQ
minvalue 1000
increment by 2
cache 1000;
CREATE TABLE logging_event
(
timestmp NUMBER(20) NULL,
formatted_message VARCHAR2(4000) NULL,
logger_name VARCHAR(254) NULL,
level_string VARCHAR(254) NULL,
thread_name VARCHAR(254) NULL,
reference_flag SMALLINT NULL,
arg0 VARCHAR(254) NULL,
arg1 VARCHAR(254) NULL,
arg2 VARCHAR(254) NULL,
arg3 VARCHAR(254) NULL,
caller_filename VARCHAR(254) NULL,
caller_class VARCHAR(254) NULL,
caller_method VARCHAR(254) NULL,
caller_line CHAR(4) NULL,
event_id NUMBER(10) NULL
-- event_id NUMBER(10) PRIMARY KEY
);
-- the / suffix may or may not be needed depending on your SQL Client
-- Some SQL Clients, e.g. SQuirrel SQL has trouble with the following
-- trigger creation command, while SQLPlus (the basic SQL Client which
-- ships with Oracle) has no trouble at all.
CREATE TRIGGER logging_event_id_seq_trig
BEFORE INSERT ON logging_event
FOR EACH ROW
BEGIN
SELECT logging_event_id_seq.NEXTVAL
INTO :NEW.event_id
FROM DUAL;
END;
/
CREATE TABLE logging_event_property
(
event_id NUMBER(10) NULL,
mapped_key VARCHAR2(254) NULL,
mapped_value VARCHAR2(1024) NULL
);
CREATE TABLE logging_event_exception
(
event_id NUMBER(10) NULL,
i SMALLINT NULL,
trace_line VARCHAR2(254) NULL
);
/
-------------------------------------
LOGCAT output: note the entry:
01-16 07:42:02.826: I/System.out(23786): 07:42:02,835 |-INFO in ch.qos.logback.core.db.DriverManagerConnectionSource@425d5588 - supportsGetGeneratedKeys=false
01-16 07:42:02.576: E/Trace(23786): error opening trace file: No such file or directory (2)
01-16 07:42:02.693: I/System.out(23786): 07:42:02,652 |-INFO in ch.qos.logback.classic.LoggerContext[default] - Found resource [assets/logback.xml] at [assets/logback.xml]
01-16 07:42:02.701: I/System.out(23786): 07:42:02,707 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - About to instantiate appender of type [ch.qos.logback.classic.db.DBAppender]
01-16 07:42:02.701: I/System.out(23786): 07:42:02,709 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - Naming appender as [DB]
01-16 07:42:02.803: D/libc(23786): Forward DNS query to netd(h=localhost s=^)
01-16 07:42:02.826: I/System.out(23786): 07:42:02,834 |-INFO in ch.qos.logback.core.db.DriverManagerConnectionSource@425d5588 - Driver name=Oracle JDBC driver
01-16 07:42:02.826: I/System.out(23786): 07:42:02,835 |-INFO in ch.qos.logback.core.db.DriverManagerConnectionSource@425d5588 - Driver version=10.1.0.5.0
01-16 07:42:02.826: I/System.out(23786): 07:42:02,835 |-INFO in ch.qos.logback.core.db.DriverManagerConnectionSource@425d5588 - supportsGetGeneratedKeys=false
01-16 07:42:02.826: I/System.out(23786): 07:42:02,837 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - About to instantiate appender of type [ch.qos.logback.classic.android.LogcatAppender]
01-16 07:42:02.826: I/System.out(23786): 07:42:02,838 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - Naming appender as [logcat]
01-16 07:42:02.842: I/System.out(23786): 07:42:02,849 |-INFO in ch.qos.logback.core.joran.action.NestedComplexPropertyIA - Assuming default type [ch.qos.logback.classic.encoder.PatternLayoutEncoder] for [encoder] property
01-16 07:42:02.873: I/System.out(23786): 07:42:02,883 |-INFO in ch.qos.logback.classic.joran.action.RootLoggerAction - Setting level of ROOT logger to ALL
01-16 07:42:02.873: I/System.out(23786): 07:42:02,884 |-INFO in ch.qos.logback.core.joran.action.AppenderRefAction - Attaching appender named [DB] to Logger[ROOT]
01-16 07:42:02.873: I/System.out(23786): 07:42:02,885 |-INFO in ch.qos.logback.core.joran.action.AppenderRefAction - Attaching appender named [logcat] to Logger[ROOT]
01-16 07:42:02.873: I/System.out(23786): 07:42:02,885 |-INFO in ch.qos.logback.classic.joran.action.ConfigurationAction - End of configuration.
01-16 07:42:02.881: I/System.out(23786): 07:42:02,886 |-INFO in ch.qos.logback.classic.joran.JoranConfigurator@42561688 - Registering current configuration as safe fallback point
01-16 07:42:03.076: D/dalvikvm(23786): GC_CONCURRENT freed 1251K, 14% free 8668K/10019K, paused 12ms+13ms, total 48ms
01-16 07:42:03.170: V/com.ntier.android.jdbctest.MainActivity(23786): 07:42:02.888 14.01.16 [main] TRACE c.n.android.jdbctest.MainActivity - onCreate
01-16 07:42:03.287: V/com.ntier.android.util.AndroidConnectDB(23786): 07:42:03.214 14.01.16 [main] TRACE c.n.android.util.AndroidConnectDB - :onPreExecute()
01-16 07:42:03.381: V/com.ntier.android.jdbctest.MainActivity(23786): 07:42:03.300 14.01.16 [main] TRACE c.n.android.jdbctest.MainActivity - com.ntier.android.util.AndroidConnectDB@42580310
01-16 07:42:03.443: D/libEGL(23786): loaded /vendor/lib/egl/libEGL_POWERVR_SGX540_120.so
01-16 07:42:03.498: D/libEGL(23786): loaded /vendor/lib/egl/libGLESv1_CM_POWERVR_SGX540_120.so
01-16 07:42:03.506: D/libEGL(23786): loaded /vendor/lib/egl/libGLESv2_POWERVR_SGX540_120.so
01-16 07:42:03.897: D/OpenGLRenderer(23786): Enabling debug mode 0
01-16 07:42:04.162: V/com.ntier.android.util.AndroidConnectDB(23786): 07:42:03.306 14.01.16 [AsyncTask #1] TRACE c.n.android.util.AndroidConnectDB - doInBackground()
01-16 07:42:04.357: V/com.ntier.android.util.AndroidConnectDB(23786): 07:42:04.170 14.01.16 [AsyncTask #1] TRACE c.n.android.util.AndroidConnectDB - network detected
01-16 07:42:04.443: V/com.ntier.android.util.AndroidConnectDB(23786): 07:42:04.363 14.01.16 [AsyncTask #1] TRACE c.n.android.util.AndroidConnectDB - network connected
01-16 07:42:04.545: V/com.ntier.android.util.AndroidConnectDB(23786): 07:42:04.454 14.01.16 [AsyncTask #1] TRACE c.n.android.util.AndroidConnectDB - ConnectOra constructor
01-16 07:42:04.693: V/com.ntier.android.util.AndroidConnectDB(23786): 07:42:04.626 14.01.16 [main] TRACE c.n.android.util.AndroidConnectDB - :onPostExecute()!
I'm using Eclipse ADT latest ,
logback-android-1.0.10-2.jar ,
slf4j-api-1.7.5.jar
LOGBACK image attached.
Model: Droid RAZR
Android version: 4.1.2
If there is a better way to attach a text file I'd like to know. It seems as if this Github only allows images to be attached and not text files?
archived