Art of Logging
https://unsplash.com/photos/SId-lmFXSDU

Art of Logging

Love it or hate it, every developer needs to log in some capacity. The first step for a developer is usually to write a "Hello World" program to display something out on screen or log file. Even now, it brings so much joy thinking about the time when the first program compiled, executed, and spitted out string literals.

No alt text provided for this image

Once developers started gaining maturity and the software industry needed more structure, frameworks were developed to consolidate and configure logs. Long gone are the days when you would be needed to write a Log class that can take message and severity parameters and processes the statement. More than a decade back frameworks such as Log4J, Log4Net, Logback, NLog, etc evolved so developers don't have to reinvent the wheel. These frameworks also meant developers took log mechanisms for granted and organizations now had gigs of log files even with severity level set at "Error", which was hard to process or trace for any meaningful insight.

The next phase of evolution brought log consolidation services such as gray log, which would crunch the insane amount of log and provide an easy way for managers and production support staff to rake through and find that instance when order object was accidentally initialized to null, debugging is no fun.

https://unsplash.com/photos/59yRYIHWtzY?utm_source=unsplash&utm_medium=referral&utm_content=creditShareLink

In all of these years, we as developers have not looked at logging as anything more than a way to diagnose an issue. There needs to be a shift in the mindset of developers, log should evolve from debugging purpose to action-driven. Every action such as login, view account, update cart, added coupon should be logged in a manner that log playback provides a complete picture along with a timeline of every action took by a specific user.

Another factor that is seldom considered regarding application logs is security. While tough measures are adopted on providing access to the software, archived log files often end up on a warehouse shelf.

Cloud transition and microservices architecture present a challenge as well as an opportunity for transforming software logging in today's world where data storage is infinite and require organizations to promptly respond to events. Services such as AWS cloud watch or Azure Monitor are good services that can slurp through a tremendous amount of data from a variety of sources in almost real-time. However, that's just the beginning, these services can be configured to send alert notifications when a certain "event" occurs or a reference is found in the log file, this is good and it gets even better.

https://unsplash.com/photos/Q59HmzK38eQ?utm_source=unsplash&utm_medium=referral&utm_content=creditShareLink

Imagine a situation where an organization specified that sensitive information such as PII or Payment should never be logged unencrypted. Keeping a tab on every developer in a large organization even with strong code reviewing practice, there can be occasions where debugging code was added to print user details but not removed before production migration.

Services that I mentioned earlier can be of great help in these scenarios. Not only an alert can be set up to be notified of a breach in corporate policies, but a self-healing process can also be created that take action in real-time, without any manual interaction. Give some room to AWS Lambda and Azure functions, they bring a tremendous shift from playing catch up regarding fixing issues. Along with Cloud Watch or Monitor, Lambda & functions could be used to proactively enforcing specified company policies.

Another use of log data is generating real-time analytics and understanding trends. For example, the organization receives about 1000 orders a day and the IT group complains of getting too much traffic on the ordering server. Log analytics can identify how many users end up on the shopping cart page and used a discount code which errored out and users abandoned the cart.

However, it all comes down to the developer's strict adherence and consistency while adding logging. In conclusion, developers need to be trained on newer cloud-friendly practices of software logging while management needs to step up and create log analytics to ensure they have visibility of logging statistics. In today's world of distributed and serverless architecture, logs need to ensure non-repudiation for any and every action taken by the user.

Subash Kumaresan

Senior Full Stack Engineer @ S2 Soft Technologies Inc | M.C.A. in Computer Science

4 年

Perfect topic for a developer

Mike Blazejewski, MBA

VP, Field Operations at CompuSystems | Event Services Leader ? Operations, Digital Technology & Customer Success

4 年

Wow, great job!

回复

要查看或添加评论,请登录

Saurabh Parashar的更多文章

  • Keep Customer First ...and mean it.

    Keep Customer First ...and mean it.

    Management 101, keep your customers happy. Companies have posters and pictures inscribing similar words on office…

  • Information Security is your Job too

    Information Security is your Job too

    In today's day and age, electronic devices surround us from all directions. The fact that you are reading this article…

    2 条评论
  • Change

    Change

    Many years back my son went to a nice small elementary school that was walking distance from our house. School had a…

  • 2016 could be year of Innovation!! #BigIdeas2016

    2016 could be year of Innovation!! #BigIdeas2016

    It is 2016, We are looking forward to this New Year and hoping it will be a turnaround year bringing good fortune to…

  • Next year's Technology boom will be...

    Next year's Technology boom will be...

    Working in tech industry, I keep pondering over new ideas and new gadgets that come out every year. Over time we seem…

社区洞察

其他会员也浏览了