Saya telah mencoba mengubah logging ke konsol modul python neo4j untuk hanya menampilkan pesan penting sebagai berikut:

neo4j_log = logging.getLogger("neo4j.bolt")
neo4j_log.setLevel(logging.CRITICAL)

Tetapi saya masih mendapatkan pencatatan yang sangat verbose dari setiap pembuatan simpul yang berhasil. Saya mencoba membaca data dari Oracle dalam ratusan ribu, dan ini saya yakin tidak membantu kinerja.

[#F2D8]  S: SUCCESS {'stats': {'labels-added': 1, 'nodes-created': 1, 'properties-set': 3}, 'type': 'w', 't_last': 0, 'db': 'neo4j'}
[#F2D8]  S: SUCCESS {'t_first': 0, 'fields': [], 'qid': 539}
[#F2D8]  C: RUN 'CREATE (p:Product) SET p.id = $id, p.preferred_trade_name = $ppn, p.dosage_form=$df ' {'id': 1221, 'ppn': 'product_x', 'df': 'Blank Values'} {}

Bukannya bagian Oracle relevan, karena ini adalah output logging CYPHER tetapi pada dasarnya saya melakukan ini:

def create_graph_nodes_marketing_applications(tx):
    print("Processing marketing application")
    sql = """
            SELECT VERSION_SEQ, DRUG_PRODUCT_ID,  REGISTRATION_SET_ID, REGISTRATION_UID, DOSSIER_REF_NUMBER AS REG_NAME_DETAILS,
                REGISTRATION_NUMBER, NEXT_RENEWAL_DATE, 
                CASE WHEN RENEWAL_NOT_REQUIRED = 'Y' Then 'No' ELSE CASE WHEN RENEWAL_NOT_REQUIRED = 'N' Then 'Yes' ELSE NULL END END AS RENEWAL_REQUIRED,
                APPLICATION_TYPE,
                APPLICATION_STAGE,
                COUNTRY_DISPLAY_LABEL,
                DISTRIBUTION_TYPE AS PROCEDURE_TYPE,
                DATA_STATE
                FROM DIM_REGISTRATION_SET WHERE DATA_STATE = 'C' AND FLAG_PASSIVE='0'
                AND APPLICATION_TYPE = 'Marketing Application'                
                
        """
    cursor_ariel.execute(sql)
    for row in cursor_ariel.fetchall():
        r = reg(cursor_ariel, row, False)

        tx.run("""
               CREATE (m:MarketingApplication:Registration) 
               SET  m.id                    =   $id,
                 
                    m.REGISTRATION_SET_ID   =   $rsid,
                    m.DRUG_PRODUCT_ID       =   $dpid,
                    m.REGISTRATION_UID      =   $ruid,
                    m.COUNTRY               =   $country,
                    m.PROCEDURE_TYPE        =   $proc,
                    m.REG_NAME_DETAILS      =   $rnd,
                    m.APPLICATION_TYPE      =   $apptype,
                    m.APPLICATION_STAGE     =   $appstage,
                    m.DATA_STATE            =   $state, 
                    m.RENEWAL_REQUIRED      =   $renewal,
                    m.NEXT_RENEWAL_DATE     =   $renewal_date""",
                    id                      =   r.VERSION_SEQ,
                    rsid                    =   r.REGISTRATION_SET_ID,
                    dpid                    =   r.DRUG_PRODUCT_ID,
                    ruid                    =   r.REGISTRATION_UID,
                    country                 =   r.COUNTRY_DISPLAY_LABEL,
                    proc                    =   r.PROCEDURE_TYPE,
                    rnd                     =   r.REG_NAME_DETAILS,
                    apptype                 =   r.APPLICATION_TYPE,
                    appstage                =   r.APPLICATION_STAGE,
                    state                   =   r.DATA_STATE,
                    renewal                 =   r.RENEWAL_REQUIRED,
                    renewal_date            =   r.NEXT_RENEWAL_DATE
               )
0
smackenzie 12 November 2020, 18:43

1 menjawab

Jawaban Terbaik

Berdasarkan pada sumber driver 4.x , saya yakin logger hanya bernama "neo4j".

0
fbiville 17 November 2020, 16:50