Quantcast

Customize data logging

classic Classic list List threaded Threaded
10 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Customize data logging

Antonio Osorio
Hi All,

Does any know if it is possible to customize the log statements output to the data log?

For example currently an entry reads:

014-07-07 21:37:16,215 INFO  jenkins-0 thread-0 [ run-0, test-1008 ]: http://localhost:9080/endpoint/ -> 200 OK, 1262229     bytes

I would like to include the time it took to perform the call.

Regards,

Antonio
------------------------------------------------------------------------------
Open source business process management suite built on Java and Eclipse
Turn processes into business applications with Bonita BPM Community Edition
Quickly connect people, data, and systems into organized workflows
Winner of BOSSIE, CODIE, OW2 and Gartner awards
http://p.sf.net/sfu/Bonitasoft
_______________________________________________
grinder-use mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/grinder-use
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Customize data logging

Joan Picanyol i Puig
* Antonio Osorio <[hidden email]> [20140708 19:36]:
> Does any know if it is possible to customize the log statements output to the data log?
>
> For example currently an entry reads:
>
> > 014-07-07 21:37:16,215 INFO  jenkins-0 thread-0 [ run-0, test-1008 ]: http://localhost:9080/endpoint/ -> 200 OK, 1262229     bytes
>
> I would like to include the time it took to perform the call.

You'd need to edit the source and recompile, see
net.grinder.plugin.http.HTTPRequest.getHTTPResponse().

If you don't feel like modifying the source and recompiling, you could
extend HTTPRequest overriding processResponse() to log an additional
line to suit your needs.

However, I'm unsure why you'd want to do this: you already have this
information in the data files.

qvb
--
pica

------------------------------------------------------------------------------
Open source business process management suite built on Java and Eclipse
Turn processes into business applications with Bonita BPM Community Edition
Quickly connect people, data, and systems into organized workflows
Winner of BOSSIE, CODIE, OW2 and Gartner awards
http://p.sf.net/sfu/Bonitasoft
_______________________________________________
grinder-use mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/grinder-use
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

question about Grinder test data to database

Gang Yan
In reply to this post by Antonio Osorio

Hi All:

 

I want to send Grinder test data  to database. I execute follow this link:

 

http://grinder.sourceforge.net/g3/logging.html

 

I have question:

 

1: modify logback-worker.xml,Add follow content:

 

<logger name="data" additivity="false">

     <appender-ref ref="data-file" />

     <appender-ref ref="data-db" />

   </logger>

 

   Previous content need to keep or delete?

 

    <logger name="worker" additivity="false">

      <appender-ref ref="log-file" />

    </logger>

 

    <logger name="data" additivity="false">

      <appender-ref ref="data-file" />

</logger>

 

 

2: Create suitable user in database? Execute follow SQL?

 

-- This SQL script creates the required tables by ch.qos.logback.classic.db.DBAppender

-- It is intended for Oracle databases.

-- The following lines are useful in cleaning any previous tables

--drop TRIGGER logging_event_id_seq_trig;

--drop SEQUENCE logging_event_id_seq;

--drop table logging_event_property;

--drop table logging_event_exception;

--drop table logging_event;

 

 

CREATE SEQUENCE logging_event_id_seq MINVALUE 1 START WITH 1;

 

CREATE TABLE logging_event

  (

    timestmp         NUMBER(20) NOT NULL,

   formatted_message  VARCHAR2(4000) NOT NULL,

    logger_name       VARCHAR(254) NOT NULL,

    level_string      VARCHAR(254) NOT NULL,

    thread_name       VARCHAR(254),

    reference_flag    SMALLINT,

    caller_filename   VARCHAR(254) NOT NULL,

    caller_class      VARCHAR(254) NOT NULL,

    caller_method     VARCHAR(254) NOT NULL,

    caller_line       CHAR(4) NOT NULL,

    event_id          NUMBER(10) PRIMARY KEY

  );

 

 

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 logging_event_id_seq_trig;

 

 

CREATE TABLE logging_event_property

  (

    event_id        NUMBER(10) NOT NULL,

    mapped_key        VARCHAR2(254) NOT NULL,

    mapped_value      VARCHAR2(1024),

    PRIMARY KEY(event_id, mapped_key),

    FOREIGN KEY (event_id) REFERENCES logging_event(event_id)

  );

 

CREATE TABLE logging_event_exception

  (

    event_id         NUMBER(10) NOT NULL,

    i                SMALLINT NOT NULL,

    trace_line       VARCHAR2(254) NOT NULL,

    PRIMARY KEY(event_id, i),

    FOREIGN KEY (event_id) REFERENCES logging_event(event_id)

  );

 

 

 

 


------------------------------------------------------------------------------
Open source business process management suite built on Java and Eclipse
Turn processes into business applications with Bonita BPM Community Edition
Quickly connect people, data, and systems into organized workflows
Winner of BOSSIE, CODIE, OW2 and Gartner awards
http://p.sf.net/sfu/Bonitasoft
_______________________________________________
grinder-use mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/grinder-use
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: question about Grinder test data to database

Philip Aston-2
On 10/07/14 12:50, Gang Yan wrote:

Hi All:

 

I want to send Grinder test data  to database. I execute follow this link:

 

http://grinder.sourceforge.net/g3/logging.html

 

I have question:

 

1: modify logback-worker.xml,Add follow content:

 

<logger name="data" additivity="false">

     <appender-ref ref="data-file" />

     <appender-ref ref="data-db" />

   </logger>

 

   Previous content need to keep or delete?

 

    <logger name="worker" additivity="false">

      <appender-ref ref="log-file" />

    </logger>

 

    <logger name="data" additivity="false">

      <appender-ref ref="data-file" />

</logger>

 


Change the "data" logger so it has the additional appender line. Don't delete the "worker" logger, or you'll disable the normal logging.


 

2: Create suitable user in database? Execute follow SQL?


Yes, that looks right to me. Make sure you're using the DDL script that corresponds to the version of logback. For The Grinder 3.11, its logback 1.0.0 => https://github.com/qos-ch/logback/blob/v_1.0.0/logback-classic/src/main/java/ch/qos/logback/classic/db/dialect/oracle.sql

For more information, refer to http://logback.qos.ch/manual/appenders.html#DBAppender

 

-- This SQL script creates the required tables by ch.qos.logback.classic.db.DBAppender

-- It is intended for Oracle databases.

-- The following lines are useful in cleaning any previous tables

--drop TRIGGER logging_event_id_seq_trig;

--drop SEQUENCE logging_event_id_seq;

--drop table logging_event_property;

--drop table logging_event_exception;

--drop table logging_event;

 

 

CREATE SEQUENCE logging_event_id_seq MINVALUE 1 START WITH 1;

 

CREATE TABLE logging_event

  (

    timestmp         NUMBER(20) NOT NULL,

   formatted_message  VARCHAR2(4000) NOT NULL,

    logger_name       VARCHAR(254) NOT NULL,

    level_string      VARCHAR(254) NOT NULL,

    thread_name       VARCHAR(254),

    reference_flag    SMALLINT,

    caller_filename   VARCHAR(254) NOT NULL,

    caller_class      VARCHAR(254) NOT NULL,

    caller_method     VARCHAR(254) NOT NULL,

    caller_line       CHAR(4) NOT NULL,

    event_id          NUMBER(10) PRIMARY KEY

  );

 

 

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 logging_event_id_seq_trig;

 

 

CREATE TABLE logging_event_property

  (

    event_id        NUMBER(10) NOT NULL,

    mapped_key        VARCHAR2(254) NOT NULL,

    mapped_value      VARCHAR2(1024),

    PRIMARY KEY(event_id, mapped_key),

    FOREIGN KEY (event_id) REFERENCES logging_event(event_id)

  );

 

CREATE TABLE logging_event_exception

  (

    event_id         NUMBER(10) NOT NULL,

    i                SMALLINT NOT NULL,

    trace_line       VARCHAR2(254) NOT NULL,

    PRIMARY KEY(event_id, i),

    FOREIGN KEY (event_id) REFERENCES logging_event(event_id)

  );

 

 

 

 



------------------------------------------------------------------------------
Open source business process management suite built on Java and Eclipse
Turn processes into business applications with Bonita BPM Community Edition
Quickly connect people, data, and systems into organized workflows
Winner of BOSSIE, CODIE, OW2 and Gartner awards
http://p.sf.net/sfu/Bonitasoft
_______________________________________________
grinder-use mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/grinder-use
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: question about Grinder test data to database

Gang Yan

Hi  Philip:

 

I modify logback-worker.xml:

 

  <appender name="data-db" class="ch.qos.logback.classic.db.DBAppender">

     <connectionSource class="ch.qos.logback.core.db.DriverManagerConnectionSource">

     <driverClass>oracle.jdbc.OracleDriver</driverClass>

     <url>jdbc:oracle:thin:@localhost:1521:XE</url>

     <user>grinder</user>

     <password>grinder</password>

     </connectionSource>

  </appender>

 

  <logger name="worker" additivity="false">

     <appender-ref ref="log-file" />

  </logger>

 

  <logger name="data" additivity="false">

     <appender-ref ref="data-file" />

     <appender-ref ref="data-db" />

  </logger>

 

</configuration>

 

Thank you!

 

--
Oracle

From: Philip Aston [mailto:[hidden email]]
Sent: 2014
711 19:23
To: grinder-use
Subject: Re: [Grinder-use] question about Grinder test data to database

 

On 10/07/14 12:50, Gang Yan wrote:

Hi All:

 

I want to send Grinder test data  to database. I execute follow this link:

 

http://grinder.sourceforge.net/g3/logging.html

 

I have question:

 

1: modify logback-worker.xml,Add follow content:

 

<logger name="data" additivity="false">

     <appender-ref ref="data-file" />

     <appender-ref ref="data-db" />

   </logger>

 

   Previous content need to keep or delete?

 

    <logger name="worker" additivity="false">

      <appender-ref ref="log-file" />

    </logger>

 

    <logger name="data" additivity="false">

      <appender-ref ref="data-file" />

</logger>

 


Change the "data" logger so it has the additional appender line. Don't delete the "worker" logger, or you'll disable the normal logging.



 

2: Create suitable user in database? Execute follow SQL?


Yes, that looks right to me. Make sure you're using the DDL script that corresponds to the version of logback. For The Grinder 3.11, its logback 1.0.0 => https://github.com/qos-ch/logback/blob/v_1.0.0/logback-classic/src/main/java/ch/qos/logback/classic/db/dialect/oracle.sql

For more information, refer to http://logback.qos.ch/manual/appenders.html#DBAppender


 

-- This SQL script creates the required tables by ch.qos.logback.classic.db.DBAppender

-- It is intended for Oracle databases.

-- The following lines are useful in cleaning any previous tables

--drop TRIGGER logging_event_id_seq_trig;

--drop SEQUENCE logging_event_id_seq;

--drop table logging_event_property;

--drop table logging_event_exception;

--drop table logging_event;

 

 

CREATE SEQUENCE logging_event_id_seq MINVALUE 1 START WITH 1;

 

CREATE TABLE logging_event

  (

    timestmp         NUMBER(20) NOT NULL,

   formatted_message  VARCHAR2(4000) NOT NULL,

    logger_name       VARCHAR(254) NOT NULL,

    level_string      VARCHAR(254) NOT NULL,

    thread_name       VARCHAR(254),

    reference_flag    SMALLINT,

    caller_filename   VARCHAR(254) NOT NULL,

    caller_class      VARCHAR(254) NOT NULL,

    caller_method     VARCHAR(254) NOT NULL,

    caller_line       CHAR(4) NOT NULL,

    event_id          NUMBER(10) PRIMARY KEY

  );

 

 

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 logging_event_id_seq_trig;

 

 

CREATE TABLE logging_event_property

  (

    event_id        NUMBER(10) NOT NULL,

    mapped_key        VARCHAR2(254) NOT NULL,

    mapped_value      VARCHAR2(1024),

    PRIMARY KEY(event_id, mapped_key),

    FOREIGN KEY (event_id) REFERENCES logging_event(event_id)

  );

 

CREATE TABLE logging_event_exception

  (

    event_id         NUMBER(10) NOT NULL,

    i                SMALLINT NOT NULL,

    trace_line       VARCHAR2(254) NOT NULL,

    PRIMARY KEY(event_id, i),

    FOREIGN KEY (event_id) REFERENCES logging_event(event_id)

  );

 

 

 

 

 


------------------------------------------------------------------------------
Want fast and easy access to all the code in your enterprise? Index and
search up to 200,000 lines of code with a free copy of Black Duck
Code Sight - the same software that powers the world's largest code
search on Ohloh, the Black Duck Open Hub! Try it now.
http://p.sf.net/sfu/bds
_______________________________________________
grinder-use mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/grinder-use
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: question about Grinder test data to database

Gang Yan
In reply to this post by Philip Aston-2

Hi  Philip

 

I’m now store Grinder test data to database. Thank you help!

 

I have question about database table.

 

1: My will be executed test many times. I want to extend table logging_event.

 

What to do?

 

Thank!

 

 

 

 

--
Oracle
Yan Gang


ORACLE China

Green Oracle

Oracle is committed to developing practices and products that help protect the environment

 

From: Philip Aston [mailto:[hidden email]]
Sent: 2014
711 19:23
To: grinder-use
Subject: Re: [Grinder-use] question about Grinder test data to database

 

On 10/07/14 12:50, Gang Yan wrote:

Hi All:

 

I want to send Grinder test data  to database. I execute follow this link:

 

http://grinder.sourceforge.net/g3/logging.html

 

I have question:

 

1: modify logback-worker.xml,Add follow content:

 

<logger name="data" additivity="false">

     <appender-ref ref="data-file" />

     <appender-ref ref="data-db" />

   </logger>

 

   Previous content need to keep or delete?

 

    <logger name="worker" additivity="false">

      <appender-ref ref="log-file" />

    </logger>

 

    <logger name="data" additivity="false">

      <appender-ref ref="data-file" />

</logger>

 


Change the "data" logger so it has the additional appender line. Don't delete the "worker" logger, or you'll disable the normal logging.



 

2: Create suitable user in database? Execute follow SQL?


Yes, that looks right to me. Make sure you're using the DDL script that corresponds to the version of logback. For The Grinder 3.11, its logback 1.0.0 => https://github.com/qos-ch/logback/blob/v_1.0.0/logback-classic/src/main/java/ch/qos/logback/classic/db/dialect/oracle.sql

For more information, refer to http://logback.qos.ch/manual/appenders.html#DBAppender


 

-- This SQL script creates the required tables by ch.qos.logback.classic.db.DBAppender

-- It is intended for Oracle databases.

-- The following lines are useful in cleaning any previous tables

--drop TRIGGER logging_event_id_seq_trig;

--drop SEQUENCE logging_event_id_seq;

--drop table logging_event_property;

--drop table logging_event_exception;

--drop table logging_event;

 

 

CREATE SEQUENCE logging_event_id_seq MINVALUE 1 START WITH 1;

 

CREATE TABLE logging_event

  (

    timestmp         NUMBER(20) NOT NULL,

   formatted_message  VARCHAR2(4000) NOT NULL,

    logger_name       VARCHAR(254) NOT NULL,

    level_string      VARCHAR(254) NOT NULL,

    thread_name       VARCHAR(254),

    reference_flag    SMALLINT,

    caller_filename   VARCHAR(254) NOT NULL,

    caller_class      VARCHAR(254) NOT NULL,

    caller_method     VARCHAR(254) NOT NULL,

    caller_line       CHAR(4) NOT NULL,

    event_id          NUMBER(10) PRIMARY KEY

  );

 

 

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 logging_event_id_seq_trig;

 

 

CREATE TABLE logging_event_property

  (

    event_id        NUMBER(10) NOT NULL,

    mapped_key        VARCHAR2(254) NOT NULL,

    mapped_value      VARCHAR2(1024),

    PRIMARY KEY(event_id, mapped_key),

    FOREIGN KEY (event_id) REFERENCES logging_event(event_id)

  );

 

CREATE TABLE logging_event_exception

  (

    event_id         NUMBER(10) NOT NULL,

    i                SMALLINT NOT NULL,

    trace_line       VARCHAR2(254) NOT NULL,

    PRIMARY KEY(event_id, i),

    FOREIGN KEY (event_id) REFERENCES logging_event(event_id)

  );

 

 

 

 

 


------------------------------------------------------------------------------
Want fast and easy access to all the code in your enterprise? Index and
search up to 200,000 lines of code with a free copy of Black Duck
Code Sight - the same software that powers the world's largest code
search on Ohloh, the Black Duck Open Hub! Try it now.
http://p.sf.net/sfu/bds
_______________________________________________
grinder-use mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/grinder-use
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: question about Grinder test data to database

Philip Aston-2
I'm sure logback will simply append to the table. You should check that your database configuration allocates sufficient tablespace.

- Phil

On 25/07/14 15:23, Gang Yan wrote:

Hi  Philip

 

I’m now store Grinder test data to database. Thank you help!

 

I have question about database table.

 

1: My will be executed test many times. I want to extend table logging_event.

 

What to do?

 

Thank!

 

 

 

 

--
Oracle
Yan Gang


ORACLE China

Green Oracle

Oracle is committed to developing practices and products that help protect the environment

 

From: Philip Aston [[hidden email]]
Sent: 2014
711 19:23
To: grinder-use
Subject: Re: [Grinder-use] question about Grinder test data to database

 

On 10/07/14 12:50, Gang Yan wrote:

Hi All:

 

I want to send Grinder test data  to database. I execute follow this link:

 

http://grinder.sourceforge.net/g3/logging.html

 

I have question:

 

1: modify logback-worker.xml,Add follow content:

 

<logger name="data" additivity="false">

     <appender-ref ref="data-file" />

     <appender-ref ref="data-db" />

   </logger>

 

   Previous content need to keep or delete?

 

    <logger name="worker" additivity="false">

      <appender-ref ref="log-file" />

    </logger>

 

    <logger name="data" additivity="false">

      <appender-ref ref="data-file" />

</logger>

 


Change the "data" logger so it has the additional appender line. Don't delete the "worker" logger, or you'll disable the normal logging.



 

2: Create suitable user in database? Execute follow SQL?


Yes, that looks right to me. Make sure you're using the DDL script that corresponds to the version of logback. For The Grinder 3.11, its logback 1.0.0 => https://github.com/qos-ch/logback/blob/v_1.0.0/logback-classic/src/main/java/ch/qos/logback/classic/db/dialect/oracle.sql

For more information, refer to http://logback.qos.ch/manual/appenders.html#DBAppender


 

-- This SQL script creates the required tables by ch.qos.logback.classic.db.DBAppender

-- It is intended for Oracle databases.

-- The following lines are useful in cleaning any previous tables

--drop TRIGGER logging_event_id_seq_trig;

--drop SEQUENCE logging_event_id_seq;

--drop table logging_event_property;

--drop table logging_event_exception;

--drop table logging_event;

 

 

CREATE SEQUENCE logging_event_id_seq MINVALUE 1 START WITH 1;

 

CREATE TABLE logging_event

  (

    timestmp         NUMBER(20) NOT NULL,

   formatted_message  VARCHAR2(4000) NOT NULL,

    logger_name       VARCHAR(254) NOT NULL,

    level_string      VARCHAR(254) NOT NULL,

    thread_name       VARCHAR(254),

    reference_flag    SMALLINT,

    caller_filename   VARCHAR(254) NOT NULL,

    caller_class      VARCHAR(254) NOT NULL,

    caller_method     VARCHAR(254) NOT NULL,

    caller_line       CHAR(4) NOT NULL,

    event_id          NUMBER(10) PRIMARY KEY

  );

 

 

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 logging_event_id_seq_trig;

 

 

CREATE TABLE logging_event_property

  (

    event_id        NUMBER(10) NOT NULL,

    mapped_key        VARCHAR2(254) NOT NULL,

    mapped_value      VARCHAR2(1024),

    PRIMARY KEY(event_id, mapped_key),

    FOREIGN KEY (event_id) REFERENCES logging_event(event_id)

  );

 

CREATE TABLE logging_event_exception

  (

    event_id         NUMBER(10) NOT NULL,

    i                SMALLINT NOT NULL,

    trace_line       VARCHAR2(254) NOT NULL,

    PRIMARY KEY(event_id, i),

    FOREIGN KEY (event_id) REFERENCES logging_event(event_id)

  );

 

 

 

 



------------------------------------------------------------------------------
Want fast and easy access to all the code in your enterprise? Index and
search up to 200,000 lines of code with a free copy of Black Duck
Code Sight - the same software that powers the world's largest code
search on Ohloh, the Black Duck Open Hub! Try it now.
http://p.sf.net/sfu/bds
_______________________________________________
grinder-use mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/grinder-use
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: question about Grinder test data to database

Gang Yan

Hi  Philip

 

I have question about table logging_event:

I don’t know about  Field formatted_message.?

 

 

select TIMESTMP , FORMATTED_MESSAGE , LOGGER_NAME ,THREAD_NAME,REFERENCE_FLAG ,caller_method ,caller_class from logging_eventlogging_event

 

1406366886806 9, 0, 1, 1406366885343, 1462, 0          data       thread 9                1 report               net.grinder.engine.process.ThreadDataLogger

1406366886844 3, 0, 1, 1406366885551, 1293, 0          data       thread 3                1 report               net.grinder.engine.process.ThreadDataLogger

1406366886985 4, 0, 1, 1406366885456, 1528, 0          data       thread 4                1 report               net.grinder.engine.process.ThreadDataLogger

1406366887218 2, 0, 1, 1406366886104, 1114, 0          data       thread 2                1 report               net.grinder.engine.process.ThreadDataLogger

1406366887297 7, 0, 1, 1406366886031, 1265, 0          data       thread 7                1 report               net.grinder.engine.process.ThreadDataLogger

1406366887575 6, 0, 1, 1406366886245, 1329, 0          data       thread 6                1 report               net.grinder.engine.process.ThreadDataLogger

1406366887640 0, 0, 1, 1406366886196, 1444, 0          data       thread 0                1 report               net.grinder.engine.process.ThreadDataLogger

1406366887945 9, 0, 1, 1406366886863, 1082, 0          data       thread 9                1 report               net.grinder.engine.process.ThreadDataLogger

1406366888058 1, 0, 1, 1406366886604, 1454, 0          data       thread 1                1 report               net.grinder.engine.process.ThreadDataLogger

1406366837754 4, 0, 1, 1406366836375, 1379, 0          data       thread 4                1 report               net.grinder.engine.process.ThreadDataLogger

1406366934037 7, 0, 1, 1406366932729, 1308, 0          data       thread 7                1 report               net.grinder.engine.process.ThreadDataLogger

1406366934835 9, 0, 1, 1406366933351, 1484, 0          data       thread 9                1 report               net.grinder.engine.process.ThreadDataLogger

1406366935544 7, 0, 1, 1406366934087, 1457, 0          data       thread 7                1 report               net.grinder.engine.process.ThreadDataLogger

1406366935670 0, 0, 1, 1406366934217, 1453, 0          data       thread 0                1 report               net.grinder.engine.process.ThreadDataLogger

1406366936171 9, 0, 1, 1406366934886, 1285, 0          data       thread 9                1 report               net.grinder.engine.process.ThreadDataLogger

1406366937061 3, 0, 1, 1406366935764, 1297, 0          data       thread 3                1 report               net.grinder.engine.process.ThreadDataLogger

1406366937681 8, 0, 1, 1406366936203, 1477, 0          data       thread 8                1 report               net.grinder.engine.process.ThreadDataLogger

1406366938916 9, 0, 1, 1406366937597, 1318, 0          data       thread 9                1 report               net.grinder.engine.process.ThreadDataLogger

1406366939714 3, 0, 1, 1406366938574, 1139, 0          data       thread 3                1 report               net.grinder.engine.process.ThreadDataLogger

1406366939800 0, 0, 1, 1406366938339, 1460, 0          data       thread 0                1 report               net.grinder.engine.process.ThreadDataLogger

1406366941118 3, 0, 1, 1406366939766, 1351, 0          data       thread 3                1 report               net.grinder.engine.process.ThreadDataLogger

1406366941563 8, 0, 1, 1406366940368, 1195, 0          data       thread 8                1 report               net.grinder.engine.process.ThreadDataLogger

1406366942471 0, 0, 1, 1406366941083, 1388, 0          data       thread 0                1 report               net.grinder.engine.process.ThreadDataLogger

1406366944124 6, 0, 1, 1406366942877, 1247, 0          data       thread 6                1 report               net.grinder.engine.process.ThreadDataLogger

1406366945355 7, 0, 1, 1406366944053, 1301, 0          data       thread 7                1 report               net.grinder.engine.process.ThreadDataLogger

1406366946851 3, 0, 1, 1406366945412, 1438, 0          data       thread 3                1 report               net.grinder.engine.process.ThreadDataLogger

1406366949905 7, 0, 1, 1406366948435, 1470, 0          data       thread 7                1 report               net.grinder.engine.process.ThreadDataLogger

1406366949966 4, 0, 1, 1406366948531, 1435, 0          data       thread 4                1 report               net.grinder.engine.process.ThreadDataLogger

1406366950327 9, 0, 1, 1406366948993, 1334, 0          data       thread 9                1 report               net.grinder.engine.process.ThreadDataLogger

1406366847135 2, 0, 1, 1406366845671, 1464, 0          data       thread 2                1 report               net.grinder.engine.process.ThreadDataLogger

1406366870158 9, 0, 1, 1406366868875, 1283, 0          data       thread 9                1 report               net.grinder.engine.process.ThreadDataLogger

1406366914845 1, 0, 1, 1406366913616, 1229, 0          data       thread 1                1 report               net.grinder.engine.process.ThreadDataLogger

 

--

From: Philip Aston [mailto:[hidden email]]
Sent: 2014
726 13:22
To: grinder-use
Subject: Re: [Grinder-use] question about Grinder test data to database

 

I'm sure logback will simply append to the table. You should check that your database configuration allocates sufficient tablespace.

- Phil

On 25/07/14 15:23, Gang Yan wrote:

Hi  Philip

 

I’m now store Grinder test data to database. Thank you help!

 

I have question about database table.

 

1: My will be executed test many times. I want to extend table logging_event.

 

What to do?

 

Thank!

 

 

 

 

--
Oracle
Yan Gang


ORACLE China

Green Oracle

Oracle is committed to developing practices and products that help protect the environment

 

From: Philip Aston [[hidden email]]
Sent: 2014
711 19:23
To: grinder-use
Subject: Re: [Grinder-use] question about Grinder test data to database

 

On 10/07/14 12:50, Gang Yan wrote:

Hi All:

 

I want to send Grinder test data  to database. I execute follow this link:

 

http://grinder.sourceforge.net/g3/logging.html

 

I have question:

 

1: modify logback-worker.xml,Add follow content:

 

<logger name="data" additivity="false">

     <appender-ref ref="data-file" />

     <appender-ref ref="data-db" />

   </logger>

 

   Previous content need to keep or delete?

 

    <logger name="worker" additivity="false">

      <appender-ref ref="log-file" />

    </logger>

 

    <logger name="data" additivity="false">

      <appender-ref ref="data-file" />

</logger>

 


Change the "data" logger so it has the additional appender line. Don't delete the "worker" logger, or you'll disable the normal logging.




 

2: Create suitable user in database? Execute follow SQL?


Yes, that looks right to me. Make sure you're using the DDL script that corresponds to the version of logback. For The Grinder 3.11, its logback 1.0.0 => https://github.com/qos-ch/logback/blob/v_1.0.0/logback-classic/src/main/java/ch/qos/logback/classic/db/dialect/oracle.sql

For more information, refer to http://logback.qos.ch/manual/appenders.html#DBAppender



 

-- This SQL script creates the required tables by ch.qos.logback.classic.db.DBAppender

-- It is intended for Oracle databases.

-- The following lines are useful in cleaning any previous tables

--drop TRIGGER logging_event_id_seq_trig;

--drop SEQUENCE logging_event_id_seq;

--drop table logging_event_property;

--drop table logging_event_exception;

--drop table logging_event;

 

 

CREATE SEQUENCE logging_event_id_seq MINVALUE 1 START WITH 1;

 

CREATE TABLE logging_event

  (

    timestmp         NUMBER(20) NOT NULL,

   formatted_message  VARCHAR2(4000) NOT NULL,

    logger_name       VARCHAR(254) NOT NULL,

    level_string      VARCHAR(254) NOT NULL,

    thread_name       VARCHAR(254),

    reference_flag    SMALLINT,

    caller_filename   VARCHAR(254) NOT NULL,

    caller_class      VARCHAR(254) NOT NULL,

    caller_method     VARCHAR(254) NOT NULL,

    caller_line       CHAR(4) NOT NULL,

    event_id          NUMBER(10) PRIMARY KEY

  );

 

 

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 logging_event_id_seq_trig;

 

 

CREATE TABLE logging_event_property

  (

    event_id        NUMBER(10) NOT NULL,

    mapped_key        VARCHAR2(254) NOT NULL,

    mapped_value      VARCHAR2(1024),

    PRIMARY KEY(event_id, mapped_key),

    FOREIGN KEY (event_id) REFERENCES logging_event(event_id)

  );

 

CREATE TABLE logging_event_exception

  (

    event_id         NUMBER(10) NOT NULL,

    i                SMALLINT NOT NULL,

    trace_line       VARCHAR2(254) NOT NULL,

    PRIMARY KEY(event_id, i),

    FOREIGN KEY (event_id) REFERENCES logging_event(event_id)

  );

 

 

 

 

 


------------------------------------------------------------------------------
Want fast and easy access to all the code in your enterprise? Index and
search up to 200,000 lines of code with a free copy of Black Duck
Code Sight - the same software that powers the world's largest code
search on Ohloh, the Black Duck Open Hub! Try it now.
http://p.sf.net/sfu/bds
_______________________________________________
grinder-use mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/grinder-use
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: question about Grinder test data to database

Philip Aston-2
Its the information you would normally get in the data log.

For example, from the first line the value of FORMATTED_MESSAGE is "9, 0, 1, 1406366885343, 1462, 0". It can be parsed as follows:

Thread = 9
Run = 0
Test = 1
Start time (ms since Epoch) =
1406366885343
Test time = 1462 ms
Errors = 0

If you use the HTTP plug-in or custom statistics, there may be additional comma separated fields.

- Phil


On 26/07/14 12:47, Gang Yan wrote:

Hi  Philip

 

I have question about table logging_event:

I don’t know about  Field formatted_message.?

 

 

select TIMESTMP , FORMATTED_MESSAGE , LOGGER_NAME ,THREAD_NAME,REFERENCE_FLAG ,caller_method ,caller_class from logging_eventlogging_event

 

1406366886806 9, 0, 1, 1406366885343, 1462, 0          data       thread 9                1 report               net.grinder.engine.process.ThreadDataLogger

1406366886844 3, 0, 1, 1406366885551, 1293, 0          data       thread 3                1 report               net.grinder.engine.process.ThreadDataLogger

1406366886985 4, 0, 1, 1406366885456, 1528, 0          data       thread 4                1 report               net.grinder.engine.process.ThreadDataLogger

1406366887218 2, 0, 1, 1406366886104, 1114, 0          data       thread 2                1 report               net.grinder.engine.process.ThreadDataLogger

1406366887297 7, 0, 1, 1406366886031, 1265, 0          data       thread 7                1 report               net.grinder.engine.process.ThreadDataLogger

1406366887575 6, 0, 1, 1406366886245, 1329, 0          data       thread 6                1 report               net.grinder.engine.process.ThreadDataLogger

1406366887640 0, 0, 1, 1406366886196, 1444, 0          data       thread 0                1 report               net.grinder.engine.process.ThreadDataLogger

1406366887945 9, 0, 1, 1406366886863, 1082, 0          data       thread 9                1 report               net.grinder.engine.process.ThreadDataLogger

1406366888058 1, 0, 1, 1406366886604, 1454, 0          data       thread 1                1 report               net.grinder.engine.process.ThreadDataLogger

1406366837754 4, 0, 1, 1406366836375, 1379, 0          data       thread 4                1 report               net.grinder.engine.process.ThreadDataLogger

1406366934037 7, 0, 1, 1406366932729, 1308, 0          data       thread 7                1 report               net.grinder.engine.process.ThreadDataLogger

1406366934835 9, 0, 1, 1406366933351, 1484, 0          data       thread 9                1 report               net.grinder.engine.process.ThreadDataLogger

1406366935544 7, 0, 1, 1406366934087, 1457, 0          data       thread 7                1 report               net.grinder.engine.process.ThreadDataLogger

1406366935670 0, 0, 1, 1406366934217, 1453, 0          data       thread 0                1 report               net.grinder.engine.process.ThreadDataLogger

1406366936171 9, 0, 1, 1406366934886, 1285, 0          data       thread 9                1 report               net.grinder.engine.process.ThreadDataLogger

1406366937061 3, 0, 1, 1406366935764, 1297, 0          data       thread 3                1 report               net.grinder.engine.process.ThreadDataLogger

1406366937681 8, 0, 1, 1406366936203, 1477, 0          data       thread 8                1 report               net.grinder.engine.process.ThreadDataLogger

1406366938916 9, 0, 1, 1406366937597, 1318, 0          data       thread 9                1 report               net.grinder.engine.process.ThreadDataLogger

1406366939714 3, 0, 1, 1406366938574, 1139, 0          data       thread 3                1 report               net.grinder.engine.process.ThreadDataLogger

1406366939800 0, 0, 1, 1406366938339, 1460, 0          data       thread 0                1 report               net.grinder.engine.process.ThreadDataLogger

1406366941118 3, 0, 1, 1406366939766, 1351, 0          data       thread 3                1 report               net.grinder.engine.process.ThreadDataLogger

1406366941563 8, 0, 1, 1406366940368, 1195, 0          data       thread 8                1 report               net.grinder.engine.process.ThreadDataLogger

1406366942471 0, 0, 1, 1406366941083, 1388, 0          data       thread 0                1 report               net.grinder.engine.process.ThreadDataLogger

1406366944124 6, 0, 1, 1406366942877, 1247, 0          data       thread 6                1 report               net.grinder.engine.process.ThreadDataLogger

1406366945355 7, 0, 1, 1406366944053, 1301, 0          data       thread 7                1 report               net.grinder.engine.process.ThreadDataLogger

1406366946851 3, 0, 1, 1406366945412, 1438, 0          data       thread 3                1 report               net.grinder.engine.process.ThreadDataLogger

1406366949905 7, 0, 1, 1406366948435, 1470, 0          data       thread 7                1 report               net.grinder.engine.process.ThreadDataLogger

1406366949966 4, 0, 1, 1406366948531, 1435, 0          data       thread 4                1 report               net.grinder.engine.process.ThreadDataLogger

1406366950327 9, 0, 1, 1406366948993, 1334, 0          data       thread 9                1 report               net.grinder.engine.process.ThreadDataLogger

1406366847135 2, 0, 1, 1406366845671, 1464, 0          data       thread 2                1 report               net.grinder.engine.process.ThreadDataLogger

1406366870158 9, 0, 1, 1406366868875, 1283, 0          data       thread 9                1 report               net.grinder.engine.process.ThreadDataLogger

1406366914845 1, 0, 1, 1406366913616, 1229, 0          data       thread 1                1 report               net.grinder.engine.process.ThreadDataLogger

 

--

From: Philip Aston [[hidden email]]
Sent: 2014
726 13:22
To: grinder-use
Subject: Re: [Grinder-use] question about Grinder test data to database

 

I'm sure logback will simply append to the table. You should check that your database configuration allocates sufficient tablespace.

- Phil

On 25/07/14 15:23, Gang Yan wrote:

Hi  Philip

 

I’m now store Grinder test data to database. Thank you help!

 

I have question about database table.

 

1: My will be executed test many times. I want to extend table logging_event.

 

What to do?

 

Thank!

 

 

 

 

--
Oracle
Yan Gang


ORACLE China

Green Oracle

Oracle is committed to developing practices and products that help protect the environment

 

From: Philip Aston [[hidden email]]
Sent: 2014
711 19:23
To: grinder-use
Subject: Re: [Grinder-use] question about Grinder test data to database

 

On 10/07/14 12:50, Gang Yan wrote:

Hi All:

 

I want to send Grinder test data  to database. I execute follow this link:

 

http://grinder.sourceforge.net/g3/logging.html

 

I have question:

 

1: modify logback-worker.xml,Add follow content:

 

<logger name="data" additivity="false">

     <appender-ref ref="data-file" />

     <appender-ref ref="data-db" />

   </logger>

 

   Previous content need to keep or delete?

 

    <logger name="worker" additivity="false">

      <appender-ref ref="log-file" />

    </logger>

 

    <logger name="data" additivity="false">

      <appender-ref ref="data-file" />

</logger>

 


Change the "data" logger so it has the additional appender line. Don't delete the "worker" logger, or you'll disable the normal logging.




 

2: Create suitable user in database? Execute follow SQL?


Yes, that looks right to me. Make sure you're using the DDL script that corresponds to the version of logback. For The Grinder 3.11, its logback 1.0.0 => https://github.com/qos-ch/logback/blob/v_1.0.0/logback-classic/src/main/java/ch/qos/logback/classic/db/dialect/oracle.sql

For more information, refer to http://logback.qos.ch/manual/appenders.html#DBAppender



 

-- This SQL script creates the required tables by ch.qos.logback.classic.db.DBAppender

-- It is intended for Oracle databases.

-- The following lines are useful in cleaning any previous tables

--drop TRIGGER logging_event_id_seq_trig;

--drop SEQUENCE logging_event_id_seq;

--drop table logging_event_property;

--drop table logging_event_exception;

--drop table logging_event;

 

 

CREATE SEQUENCE logging_event_id_seq MINVALUE 1 START WITH 1;

 

CREATE TABLE logging_event

  (

    timestmp         NUMBER(20) NOT NULL,

   formatted_message  VARCHAR2(4000) NOT NULL,

    logger_name       VARCHAR(254) NOT NULL,

    level_string      VARCHAR(254) NOT NULL,

    thread_name       VARCHAR(254),

    reference_flag    SMALLINT,

    caller_filename   VARCHAR(254) NOT NULL,

    caller_class      VARCHAR(254) NOT NULL,

    caller_method     VARCHAR(254) NOT NULL,

    caller_line       CHAR(4) NOT NULL,

    event_id          NUMBER(10) PRIMARY KEY

  );

 

 

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 logging_event_id_seq_trig;

 

 

CREATE TABLE logging_event_property

  (

    event_id        NUMBER(10) NOT NULL,

    mapped_key        VARCHAR2(254) NOT NULL,

    mapped_value      VARCHAR2(1024),

    PRIMARY KEY(event_id, mapped_key),

    FOREIGN KEY (event_id) REFERENCES logging_event(event_id)

  );

 

CREATE TABLE logging_event_exception

  (

    event_id         NUMBER(10) NOT NULL,

    i                SMALLINT NOT NULL,

    trace_line       VARCHAR2(254) NOT NULL,

    PRIMARY KEY(event_id, i),

    FOREIGN KEY (event_id) REFERENCES logging_event(event_id)

  );

 

 

 

 

 



------------------------------------------------------------------------------
Want fast and easy access to all the code in your enterprise? Index and
search up to 200,000 lines of code with a free copy of Black Duck
Code Sight - the same software that powers the world's largest code
search on Ohloh, the Black Duck Open Hub! Try it now.
http://p.sf.net/sfu/bds


_______________________________________________
grinder-use mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/grinder-use


------------------------------------------------------------------------------
Infragistics Professional
Build stunning WinForms apps today!
Reboot your WinForms applications with our WinForms controls.
Build a bridge from your legacy apps to the future.
http://pubads.g.doubleclick.net/gampad/clk?id=153845071&iu=/4140/ostg.clktrk
_______________________________________________
grinder-use mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/grinder-use
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: question about Grinder test data to database

Gang Yan

Hi Philip:

 

Thank you reply!

 

I want  to grinder log and system monitor data into database During the performance test.

 

Grinder can support ?

 

 

--
Oracle
Yan Gang


ORACLE China

Green Oracle

Oracle is committed to developing practices and products that help protect the environment

 

From: Philip Aston [mailto:[hidden email]]
Sent: 2014
728 15:50
To: grinder-use
Subject: Re: [Grinder-use] question about Grinder test data to database

 

Its the information you would normally get in the data log.

For example, from the first line the value of FORMATTED_MESSAGE is "
9, 0, 1, 1406366885343, 1462, 0". It can be parsed as follows:

Thread = 9
Run = 0
Test = 1
Start time (ms since Epoch) = 1406366885343
Test time = 1462 ms
Errors = 0

If you use the HTTP plug-in or custom statistics, there may be additional comma separated fields.

- Phil


On 26/07/14 12:47, Gang Yan wrote:

Hi  Philip

 

I have question about table logging_event:

I don’t know about  Field formatted_message.?

 

 

select TIMESTMP , FORMATTED_MESSAGE , LOGGER_NAME ,THREAD_NAME,REFERENCE_FLAG ,caller_method ,caller_class from logging_eventlogging_event

 

1406366886806 9, 0, 1, 1406366885343, 1462, 0          data       thread 9                1 report               net.grinder.engine.process.ThreadDataLogger

1406366886844 3, 0, 1, 1406366885551, 1293, 0          data       thread 3                1 report               net.grinder.engine.process.ThreadDataLogger

1406366886985 4, 0, 1, 1406366885456, 1528, 0          data       thread 4                1 report               net.grinder.engine.process.ThreadDataLogger

1406366887218 2, 0, 1, 1406366886104, 1114, 0          data       thread 2                1 report               net.grinder.engine.process.ThreadDataLogger

1406366887297 7, 0, 1, 1406366886031, 1265, 0          data       thread 7                1 report               net.grinder.engine.process.ThreadDataLogger

1406366887575 6, 0, 1, 1406366886245, 1329, 0          data       thread 6                1 report               net.grinder.engine.process.ThreadDataLogger

1406366887640 0, 0, 1, 1406366886196, 1444, 0          data       thread 0                1 report               net.grinder.engine.process.ThreadDataLogger

1406366887945 9, 0, 1, 1406366886863, 1082, 0          data       thread 9                1 report               net.grinder.engine.process.ThreadDataLogger

1406366888058 1, 0, 1, 1406366886604, 1454, 0          data       thread 1                1 report               net.grinder.engine.process.ThreadDataLogger

1406366837754 4, 0, 1, 1406366836375, 1379, 0          data       thread 4                1 report               net.grinder.engine.process.ThreadDataLogger

1406366934037 7, 0, 1, 1406366932729, 1308, 0          data       thread 7                1 report               net.grinder.engine.process.ThreadDataLogger

1406366934835 9, 0, 1, 1406366933351, 1484, 0          data       thread 9                1 report               net.grinder.engine.process.ThreadDataLogger

1406366935544 7, 0, 1, 1406366934087, 1457, 0          data       thread 7                1 report               net.grinder.engine.process.ThreadDataLogger

1406366935670 0, 0, 1, 1406366934217, 1453, 0          data       thread 0                1 report               net.grinder.engine.process.ThreadDataLogger

1406366936171 9, 0, 1, 1406366934886, 1285, 0          data       thread 9                1 report               net.grinder.engine.process.ThreadDataLogger

1406366937061 3, 0, 1, 1406366935764, 1297, 0          data       thread 3                1 report               net.grinder.engine.process.ThreadDataLogger

1406366937681 8, 0, 1, 1406366936203, 1477, 0          data       thread 8                1 report               net.grinder.engine.process.ThreadDataLogger

1406366938916 9, 0, 1, 1406366937597, 1318, 0          data       thread 9                1 report               net.grinder.engine.process.ThreadDataLogger

1406366939714 3, 0, 1, 1406366938574, 1139, 0          data       thread 3                1 report               net.grinder.engine.process.ThreadDataLogger

1406366939800 0, 0, 1, 1406366938339, 1460, 0          data       thread 0                1 report               net.grinder.engine.process.ThreadDataLogger

1406366941118 3, 0, 1, 1406366939766, 1351, 0          data       thread 3                1 report               net.grinder.engine.process.ThreadDataLogger

1406366941563 8, 0, 1, 1406366940368, 1195, 0          data       thread 8                1 report               net.grinder.engine.process.ThreadDataLogger

1406366942471 0, 0, 1, 1406366941083, 1388, 0          data       thread 0                1 report               net.grinder.engine.process.ThreadDataLogger

1406366944124 6, 0, 1, 1406366942877, 1247, 0          data       thread 6                1 report               net.grinder.engine.process.ThreadDataLogger

1406366945355 7, 0, 1, 1406366944053, 1301, 0          data       thread 7                1 report               net.grinder.engine.process.ThreadDataLogger

1406366946851 3, 0, 1, 1406366945412, 1438, 0          data       thread 3                1 report               net.grinder.engine.process.ThreadDataLogger

1406366949905 7, 0, 1, 1406366948435, 1470, 0          data       thread 7                1 report               net.grinder.engine.process.ThreadDataLogger

1406366949966 4, 0, 1, 1406366948531, 1435, 0          data       thread 4                1 report               net.grinder.engine.process.ThreadDataLogger

1406366950327 9, 0, 1, 1406366948993, 1334, 0          data       thread 9                1 report               net.grinder.engine.process.ThreadDataLogger

1406366847135 2, 0, 1, 1406366845671, 1464, 0          data       thread 2                1 report               net.grinder.engine.process.ThreadDataLogger

1406366870158 9, 0, 1, 1406366868875, 1283, 0          data       thread 9                1 report               net.grinder.engine.process.ThreadDataLogger

1406366914845 1, 0, 1, 1406366913616, 1229, 0          data       thread 1                1 report               net.grinder.engine.process.ThreadDataLogger

 

--


From: Philip Aston [[hidden email]]
Sent: 2014
726 13:22
To: grinder-use
Subject: Re: [Grinder-use] question about Grinder test data to database

 

I'm sure logback will simply append to the table. You should check that your database configuration allocates sufficient tablespace.

- Phil

On 25/07/14 15:23, Gang Yan wrote:

Hi  Philip

 

I’m now store Grinder test data to database. Thank you help!

 

I have question about database table.

 

1: My will be executed test many times. I want to extend table logging_event.

 

What to do?

 

Thank!

 

 

 

 

--
Oracle
Yan Gang


ORACLE China

Green Oracle

Oracle is committed to developing practices and products that help protect the environment

 

From: Philip Aston [[hidden email]]
Sent: 2014
711 19:23
To: grinder-use
Subject: Re: [Grinder-use] question about Grinder test data to database

 

On 10/07/14 12:50, Gang Yan wrote:

Hi All:

 

I want to send Grinder test data  to database. I execute follow this link:

 

http://grinder.sourceforge.net/g3/logging.html

 

I have question:

 

1: modify logback-worker.xml,Add follow content:

 

<logger name="data" additivity="false">

     <appender-ref ref="data-file" />

     <appender-ref ref="data-db" />

   </logger>

 

   Previous content need to keep or delete?

 

    <logger name="worker" additivity="false">

      <appender-ref ref="log-file" />

    </logger>

 

    <logger name="data" additivity="false">

      <appender-ref ref="data-file" />

</logger>

 


Change the "data" logger so it has the additional appender line. Don't delete the "worker" logger, or you'll disable the normal logging.





 

2: Create suitable user in database? Execute follow SQL?


Yes, that looks right to me. Make sure you're using the DDL script that corresponds to the version of logback. For The Grinder 3.11, its logback 1.0.0 => https://github.com/qos-ch/logback/blob/v_1.0.0/logback-classic/src/main/java/ch/qos/logback/classic/db/dialect/oracle.sql

For more information, refer to http://logback.qos.ch/manual/appenders.html#DBAppender




 

-- This SQL script creates the required tables by ch.qos.logback.classic.db.DBAppender

-- It is intended for Oracle databases.

-- The following lines are useful in cleaning any previous tables

--drop TRIGGER logging_event_id_seq_trig;

--drop SEQUENCE logging_event_id_seq;

--drop table logging_event_property;

--drop table logging_event_exception;

--drop table logging_event;

 

 

CREATE SEQUENCE logging_event_id_seq MINVALUE 1 START WITH 1;

 

CREATE TABLE logging_event

  (

    timestmp         NUMBER(20) NOT NULL,

   formatted_message  VARCHAR2(4000) NOT NULL,

    logger_name       VARCHAR(254) NOT NULL,

    level_string      VARCHAR(254) NOT NULL,

    thread_name       VARCHAR(254),

    reference_flag    SMALLINT,

    caller_filename   VARCHAR(254) NOT NULL,

    caller_class      VARCHAR(254) NOT NULL,

    caller_method     VARCHAR(254) NOT NULL,

    caller_line       CHAR(4) NOT NULL,

    event_id          NUMBER(10) PRIMARY KEY

  );

 

 

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 logging_event_id_seq_trig;

 

 

CREATE TABLE logging_event_property

  (

    event_id        NUMBER(10) NOT NULL,

    mapped_key        VARCHAR2(254) NOT NULL,

    mapped_value      VARCHAR2(1024),

    PRIMARY KEY(event_id, mapped_key),

    FOREIGN KEY (event_id) REFERENCES logging_event(event_id)

  );

 

CREATE TABLE logging_event_exception

  (

    event_id         NUMBER(10) NOT NULL,

    i                SMALLINT NOT NULL,

    trace_line       VARCHAR2(254) NOT NULL,

    PRIMARY KEY(event_id, i),

    FOREIGN KEY (event_id) REFERENCES logging_event(event_id)

  );

 

 

 

 

 




------------------------------------------------------------------------------
Want fast and easy access to all the code in your enterprise? Index and
search up to 200,000 lines of code with a free copy of Black Duck
Code Sight - the same software that powers the world's largest code
search on Ohloh, the Black Duck Open Hub! Try it now.
http://p.sf.net/sfu/bds




_______________________________________________
grinder-use mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/grinder-use

 


------------------------------------------------------------------------------
Infragistics Professional
Build stunning WinForms apps today!
Reboot your WinForms applications with our WinForms controls.
Build a bridge from your legacy apps to the future.
http://pubads.g.doubleclick.net/gampad/clk?id=153845071&iu=/4140/ostg.clktrk
_______________________________________________
grinder-use mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/grinder-use
Loading...