Rocket ship badge DevOps Launchpad

Andy Barrick · 22nd May 2025

5 steps to building observability into your Salesforce development process

Observability is vital for modern DevOps, giving Salesforce teams true visibility over what’s happening within their orgs. But knowing what observability is, and understanding why it matters, is just the starting point. The real transformation comes when we learn how to effectively build observability practices into our day-to-day Salesforce development process.

It’s about shifting from a reactive stance — waiting for things to break — to a proactive one, where you’re continuously gathering insights to improve quality and stability right from the start. This isn’t about adding another layer of complexity; it’s about working smarter. So, where do you begin? Let’s explore five key practical steps to help you begin shaping your observability strategy and embedding it effectively within your Salesforce DevOps process.

1. Make errors unmissable — right from the sandbox

The first, most crucial step is to ensure that errors are made visible. It sounds obvious, but you’d be surprised how often errors, especially in early development stages, can be overlooked until they cause bigger problems down the line.

Unhandled exceptions in Salesforce will typically generate emails. That’s a start, but you need a robust process for handling these and providing visibility to the right people, promptly. Relying on email notifications alone, which can easily get lost in crowded inboxes, isn’t enough. Think about tools and processes that can centralize these notifications, like solutions for Flow error monitoring (FEM).

Crucially, pay attention to such things even in your sandboxes. While setting up sophisticated monitoring like FEM might be trickier in a sandbox, if you’re consistently getting unhandled exceptions there, investigate them. Don’t just click past them. Ignoring errors in sandboxes because “it’s just a dev environment” often leads to those same, far more costly, errors surfacing in production.

If you’re keen to get a deeper understanding of how to get on top of those tricky Flow and Apex errors before they impact your users, join Gearset’s upcoming webinar: Catch Flow and Apex errors fast: A guide to proactive Salesforce monitoring. It’s a great opportunity to dive specifically into proactive strategies in this area.

2. Strategic logging: your eyes inside transactions

Logging, and the information derived from it, is absolutely critical for understanding what’s happening within your transactions. When something goes wrong, or even when something just performs unexpectedly, well-structured logs are often your first and best source for diagnosis.

Salesforce’s standard debug logs have their place, particularly for detailed, step-by-step troubleshooting. However, they are often reactive and limited for ongoing observability. They can be verbose, and sifting through them for trends or specific insights can be cumbersome.

For true observability, you need a consistent logging mechanism across your applications. This mechanism should aim to:

  • Provide deep value: Capture enough context about the transaction state, key variables, and decision points.
  • Avoid being too verbose: Excessive logging can obscure important information and create noise.
  • Be cost-effective: If you’re using Salesforce Objects to store log information, for example, be mindful of storage limits and the potential performance impact of DML operations for logging. For high-volume logging, external logging platforms might be more appropriate.

3. Know your application, know your logs

To implement effective logging, you must understand your application architecture and, critically, your business processes. How does your application actually handle user actions from start to finish? Which parts of your automation are most critical or most prone to issues?

Once you have this understanding, you’ll find it far easier to identify the strategic points where you should inject logging to capture the state of the transaction. Consider logging at:

  • Entry and exit points of significant methods or Flows.
  • Before and after calls to external systems.
  • When complex branching logic is executed.
  • When handling or processing critical data.

The goal isn’t to log every single line of execution, but to capture meaningful data points that help you reconstruct the event and understand its context if something goes awry.

4. From log data to actionable insights

Collecting logs is just the first step. You need to ensure that the data derived from these logs is made visible and actionable. This could be through dashboards, reports, or alerts.

You can even drive processes off this log data. For instance, if you’re using Salesforce as the storage mechanism for your logs (e.g., in custom objects), you could add Apex Triggers or Flows to these log objects. This would allow you to automatically create a notification or a task if a log entry indicates something that isn’t a hard error but is worthy of a “warning light” — perhaps a transaction taking longer than usual, or a specific condition being met that warrants investigation.

5. The golden rule: start small and iterate

Trying to implement a comprehensive observability strategy across your entire Salesforce application landscape all at once will likely feel overwhelming and could be too complex to manage effectively.

That’s why it’s important to take your time and start small. Pick one critical business process or one problematic area of your application. Implement some of the logging and error visibility practices discussed here for that specific area. Learn from the process, see what works, gather feedback, and then iterate and expand from there. This incremental approach is far more likely to lead to sustainable success.

Building observability into your Salesforce development process is an ongoing journey, not a one-time project. By focusing on making errors visible, implementing strategic logging, understanding your application deeply, and making your log data actionable, you can significantly enhance the quality, stability, and performance of your Salesforce solutions.

Ready to master observability in Salesforce?

If you’re looking to take these concepts further and gain a comprehensive understanding of how to build, implement, and scale observability practices across your Salesforce projects, our Salesforce observability course is designed for you. It’s packed with practical guidance, real-world examples, and strategies to help you truly understand and improve your org’s health and performance. Get started here.