Tweeted twitter.com/StackProgrammer/status/695490065070493696
2 Improved question to avoid too-broad and primarily opinion-based language.
source | link

Our web app generates a large amount of logs. These logs include both events regarding background operations in the app (data arrives from the server, ajax failures, inter-component communication, etc.); and also user initiated actions (user clicked a button, user wrote text, etc.).

We built our own logging library with different adapters (print to console, send to server, etc.); and currently send all the logs to our server for persistence. These logs are used to analyze the behaviour and flow of the app, monitor errors, client-side exceptions, etc.

We now have a new requirement of tracking user behaviour in the app, and we consider 2 approaches:

  1. Enrich our current in-code logs (which are sent to the server) and log every user action we need to track. Then use ETL jobs to collect and analyze the data using some third party service (Omninute, Kibana, etc.).
  2. Integrate a third party service with its own JS library (Omniture, Google Analytics) and adapt our code to use that service (manually sending events from JS, HTML tagging, etc.).

The first approach keeps our code base cleaner and with less duplicationsduplication (only one logging mechanism).
The

The second approach involves modifying the app's code to send all the events we want to track to the analytics service, in addition to logging them with our own logging service. But it allows the analytics service to gather additional data which we don't need to implement ourselves (geotracking, browser and OS versions, etc.).

My questions are:What approach should I take so the code can meet both logging requirements without unnecessary code duplication and complexity?

  1. Are there any best practices I should know about?
  2. Should I consider any other advantages / disadvantages of each approach?
  3. Can anybody share their experience with such an issue?

Our web app generates a large amount of logs. These logs include both events regarding background operations in the app (data arrives from the server, ajax failures, inter-component communication, etc.); and also user initiated actions (user clicked a button, user wrote text, etc.).

We built our own logging library with different adapters (print to console, send to server, etc.); and currently send all the logs to our server for persistence. These logs are used to analyze the behaviour and flow of the app, monitor errors, client-side exceptions, etc.

We now have a new requirement of tracking user behaviour in the app, and we consider 2 approaches:

  1. Enrich our current in-code logs (which are sent to the server) and log every user action we need to track. Then use ETL jobs to collect and analyze the data using some third party service (Omninute, Kibana, etc.).
  2. Integrate a third party service with its own JS library (Omniture, Google Analytics) and adapt our code to use that service (manually sending events from JS, HTML tagging, etc.).

The first approach keeps our code base cleaner and with less duplications (only one logging mechanism).
The second approach involves modifying the app's code to send all the events we want to track to the analytics service, in addition to logging them with our own logging service. But it allows the analytics service to gather additional data which we don't need to implement ourselves (geotracking, browser and OS versions, etc.).

My questions are:

  1. Are there any best practices I should know about?
  2. Should I consider any other advantages / disadvantages of each approach?
  3. Can anybody share their experience with such an issue?

Our web app generates a large amount of logs. These logs include both events regarding background operations in the app (data arrives from the server, ajax failures, inter-component communication, etc.); and also user initiated actions (user clicked a button, user wrote text, etc.).

We built our own logging library with different adapters (print to console, send to server, etc.); and currently send all the logs to our server for persistence. These logs are used to analyze the behaviour and flow of the app, monitor errors, client-side exceptions, etc.

We now have a new requirement of tracking user behaviour in the app, and we consider 2 approaches:

  1. Enrich our current in-code logs (which are sent to the server) and log every user action we need to track. Then use ETL jobs to collect and analyze the data using some third party service (Omninute, Kibana, etc.).
  2. Integrate a third party service with its own JS library (Omniture, Google Analytics) and adapt our code to use that service (manually sending events from JS, HTML tagging, etc.).

The first approach keeps our code base cleaner and with less duplication (only one logging mechanism).

The second approach involves modifying the app's code to send all the events we want to track to the analytics service, in addition to logging them with our own logging service. But it allows the analytics service to gather additional data which we don't need to implement ourselves (geotracking, browser and OS versions, etc.).

What approach should I take so the code can meet both logging requirements without unnecessary code duplication and complexity?

1
source | link

Should we reuse web app logs for user behaviour analytics?

Our web app generates a large amount of logs. These logs include both events regarding background operations in the app (data arrives from the server, ajax failures, inter-component communication, etc.); and also user initiated actions (user clicked a button, user wrote text, etc.).

We built our own logging library with different adapters (print to console, send to server, etc.); and currently send all the logs to our server for persistence. These logs are used to analyze the behaviour and flow of the app, monitor errors, client-side exceptions, etc.

We now have a new requirement of tracking user behaviour in the app, and we consider 2 approaches:

  1. Enrich our current in-code logs (which are sent to the server) and log every user action we need to track. Then use ETL jobs to collect and analyze the data using some third party service (Omninute, Kibana, etc.).
  2. Integrate a third party service with its own JS library (Omniture, Google Analytics) and adapt our code to use that service (manually sending events from JS, HTML tagging, etc.).

The first approach keeps our code base cleaner and with less duplications (only one logging mechanism).
The second approach involves modifying the app's code to send all the events we want to track to the analytics service, in addition to logging them with our own logging service. But it allows the analytics service to gather additional data which we don't need to implement ourselves (geotracking, browser and OS versions, etc.).

My questions are:

  1. Are there any best practices I should know about?
  2. Should I consider any other advantages / disadvantages of each approach?
  3. Can anybody share their experience with such an issue?