sul-dlss / preservation_catalog

Rails application to track, audit and replicate archival artifacts associated with SDR objects.
https://sul-dlss.github.io/preservation_catalog/
Other
2 stars 2 forks source link

logging has redundancies #410

Open ndushay opened 6 years ago

ndushay commented 6 years ago

Chances are we do NOT want two messages (esp of diff severity levels) for this:

E, [2017-12-12T16:42:13.344995 #8041] ERROR -- : PreservedObjectHandler(bb092mr2464, 1, 117504541, <Endpoint: {:endpoint_name=>"services-disk14", :endpoint_type_name=>"online_nfs", :endpoint_type_class=>"online", :endpoint_node=>"localhost", :storage_location=>"/services-disk14/sdr2objects", :recovery_cost=>1}>) PreservedObject db object does not exist
I, [2017-12-12T16:42:13.345206 #8041]  INFO -- : PreservedObjectHandler(bb092mr2464, 1, 117504541, <Endpoint: {:endpoint_name=>"services-disk14", :endpoint_type_name=>"online_nfs", :endpoint_type_class=>"online", :endpoint_node=>"localhost", :storage_location=>"/services-disk14/sdr2objects", :recovery_cost=>1}>) added object to db as it did not exist
ndushay commented 6 years ago

from slack:

[5:21 PM] Julian Morley "Could we add more explicit verbage around where it doesn't exist? e.g. "Expected object not found on disk" or "Expected object not found in catalog"?

[5:21 PM] Or "added discovered object to catalog"

ndushay commented 6 years ago

At standup yesterday, Julian requested a single log message per druid.

ndushay commented 6 years ago

current logging:

when version matches:

I, [2017-12-15T07:55:19.196893 #30454]  INFO -- : PreservedObjectHandler(fx604kt9968, 1, 72062960, <Endpoint: {:endpoint_name=>"services-disk14", :endpoint_type_name=>"online_nfs", :endpoint_type_class=>"online", :endpoint_node=>"localhost", :storage_location=>"/services-disk14/sdr2objects", :recovery_cost=>1}>) incoming version (1) matches PreservedObject db version
I, [2017-12-15T07:55:19.196963 #30454]  INFO -- : PreservedObjectHandler(fx604kt9968, 1, 72062960, <Endpoint: {:endpoint_name=>"services-disk14", :endpoint_type_name=>"online_nfs", :endpoint_type_class=>"online", :endpoint_node=>"localhost", :storage_location=>"/services-disk14/sdr2objects", :recovery_cost=>1}>) PreservedCopy db object updated

when object does not exist:

E, [2017-12-15T07:58:17.554112 #30454] ERROR -- : PreservedObjectHandler(jd946hs9599, 3, 3888645, <Endpoint: {:endpoint_name=>"services-disk14", :endpoint_type_name=>"online_nfs", :endpoint_type_class=>"online", :endpoint_node=>"localhost", :storage_location=>"/services-disk14/sdr2objects", :recovery_cost=>1}>) PreservedObject db object does not exist
I, [2017-12-15T07:58:17.554241 #30454]  INFO -- : PreservedObjectHandler(jd946hs9599, 3, 3888645, <Endpoint: {:endpoint_name=>"services-disk14", :endpoint_type_name=>"online_nfs", :endpoint_type_class=>"online", :endpoint_node=>"localhost", :storage_location=>"/services-disk14/sdr2objects", :recovery_cost=>1}>) added object to db as it did not exist

when incoming version > catalog version:

I, [2017-12-15T07:49:52.939175 #30454]  INFO -- : PreservedObjectHandler(bc667wt5123, 2, 162765135, <Endpoint: {:endpoint_name=>"services-disk14", :endpoint_type_name=>"online_nfs", :endpoint_type_class=>"online", :endpoint_node=>"localhost", :storage_location=>"/services-disk14/sdr2objects", :recovery_cost=>1}>) incoming version (2) greater than PreservedCopy db version
I, [2017-12-15T07:49:52.939342 #30454]  INFO -- : PreservedObjectHandler(bc667wt5123, 2, 162765135, <Endpoint: {:endpoint_name=>"services-disk14", :endpoint_type_name=>"online_nfs", :endpoint_type_class=>"online", :endpoint_node=>"localhost", :storage_location=>"/services-disk14/sdr2objects", :recovery_cost=>1}>) incoming version (2) greater than PreservedObject db version
I, [2017-12-15T07:49:52.939438 #30454]  INFO -- : PreservedObjectHandler(bc667wt5123, 2, 162765135, <Endpoint: {:endpoint_name=>"services-disk14", :endpoint_type_name=>"online_nfs", :endpoint_type_class=>"online", :endpoint_node=>"localhost", :storage_location=>"/services-disk14/sdr2objects", :recovery_cost=>1}>) PreservedCopy db object updated
I, [2017-12-15T07:49:52.939538 #30454]  INFO -- : PreservedObjectHandler(bc667wt5123, 2, 162765135, <Endpoint: {:endpoint_name=>"services-disk14", :endpoint_type_name=>"online_nfs", :endpoint_type_class=>"online", :endpoint_node=>"localhost", :storage_location=>"/services-disk14/sdr2objects", :recovery_cost=>1}>) PreservedObject db object updated
ndushay commented 6 years ago

Now we have (for objects that don't exist):

I, [2018-02-22T15:58:23.017820 #20144]  INFO -- : check_existence(dj387pb1179, services-disk14) actual version (1) matches PreservedCopy db version
I, [2018-02-22T15:58:23.112424 #20144]  INFO -- : check_existence(dj393sw7122, services-disk14) actual version (1) matches PreservedCopy db version
W, [2018-02-22T15:58:23.344524 #20144]  WARN -- : check_existence(dj396qz7942, services-disk14) PreservedObject db object does not exist
I, [2018-02-22T15:58:23.344876 #20144]  INFO -- : check_existence(dj396qz7942, services-disk14) added object to db as it did not exist
W, [2018-02-22T15:58:23.505261 #20144]  WARN -- : check_existence(dj405dv8610, services-disk14) PreservedObject db object does not exist
I, [2018-02-22T15:58:23.505545 #20144]  INFO -- : check_existence(dj405dv8610, services-disk14) added object to db as it did not exist
I, [2018-02-22T15:58:23.570124 #20144]  INFO -- : check_existence(dj407vn6443, services-disk14) actual version (1) matches PreservedCopy db version
I, [2018-02-22T15:58:23.633021 #20144]  INFO -- : check_existence(dj411xn9734, services-disk14) actual version (1) matches PreservedCopy db version

and for Moab version > catalog version:

I, [2018-02-22T15:55:05.208706 #20144]  INFO -- : check_existence(cn175qm9496, services-disk14) actual version (2) matches PreservedCopy db version
I, [2018-02-22T15:55:05.562840 #20144]  INFO -- : check_existence(cn185mb0456, services-disk14) actual version (2) greater than PreservedCopy db version (1)
I, [2018-02-22T15:55:05.623332 #20144]  INFO -- : check_existence(cn187fm5361, services-disk14) actual version (1) matches PreservedCopy db version