Description

Log more things!

This Addon adds two new ways to use Statamic’s already great logging functionality.

Not even Chuck Norris himself will be able to stop your logging.

The Tag


The {{ logplus }} tag allows you to log messages and data directly from your templates, making it easier to debug things, and log potential issues in complex templating scenarios. It can also be used as a simple way to keep an eye on certain pages getting accessed, or query params being used.

The Controller

The controller endpoint gives you access to write to the log using JS by submitting a simple POST request with a message & optional context data. This can be especially useful when performing some complex JS logic, or connecting to third-party APIs over ajax and logging issues in the catch block.

For more details, check out the docs!

Examples

Tag

{{ logplus message="Just a simple debug message" }}
{{ if slug == "secret-page" }}
  {{ user }}
    {{
      logplus:emergency
      message="🚨 Secret page was accessed!"
      context="url:{ permalink }|user:{ username }"
    }}
  {{ /user }}
{{ /if }}

Controller

axios.post('/!/Logplus/log', { message: 'Just a simple debug message' })
axios.post(someExternalEndpoint, {...})
  .then(resp => {
    // success!
  })
  .catch(error => {
    // oh oh
    axios.post('/!/Logplus/log', {
      level: 'critical',
      message: 'Something bad happened',
      context: { data: error.data }
    })
  })

Important Links
Details
Released September 7, 2019
Updated 4 months ago
Version v1.0
Downloads 109
Requires Statamic 2.10

Aryeh Raber

More by Aryeh Raber

Similar Addons

See All
Behold! Easily unleash the power of Laravel Mix's version functionality within your Statamic site!

Statamic Mix

by Ben Furfie in CSS, JavaScript, Tag, Utility
Behold! Easily unleash the power of Laravel Mix's version functionality within your Statamic site!
Metapod allows you to interact with metadata from pages specified by URL.

Metapod

by LionsMouth Digital in Tag
Metapod allows you to interact with metadata from pages specified by URL.
Manage URL redirects intuitively, discover and fix 404's automagically, improve your SEO dramatically $19

Redirects

by Gridonic in Enhancement, Tool, Control Panel
Manage URL redirects intuitively, discover and fix 404's automagically, improve your SEO dramatically