lindemannrock/craft-shortlink-manager

Advanced shortlink management with QR codes, analytics for Craft CMS

Installs: 54

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 0

Forks: 0

Open Issues: 0

Type:craft-plugin

pkg:composer/lindemannrock/craft-shortlink-manager

5.8.0 2026-01-12 16:56 UTC

README

Latest Version Craft CMS PHP Logging Library License

Advanced shortlink management with QR codes and analytics for Craft CMS.

⚠️ Beta Notice

This plugin is currently in active development and provided under the MIT License for testing purposes.

Licensing is subject to change. We are finalizing our licensing structure and some or all features may require a paid license when officially released on the Craft Plugin Store. Some plugins may remain free, others may offer free and Pro editions, or be fully commercial.

If you are using this plugin, please be aware that future versions may have different licensing terms.

Features

Flexible Shortlink Creation

  • Auto-generated codes: Randomly generated short codes (e.g., /s/abc123)
  • Vanity URLs: Custom memorable slugs (e.g., /s/pricing)
  • Multiple destination types: Link to custom URLs, Entries, Categories, or Assets
  • Element linking: Automatically create shortlinks for Craft entries, assets, etc.
  • Custom field type: Add shortlink fields directly to your entry types

Comprehensive Analytics

  • Device Detection - Powered by Matomo DeviceDetector for accurate device, browser, and OS identification
  • Geographic Detection - Track visitor location (country, city) via ip-api.com
  • Bot Filtering - Identify and filter bot traffic (GoogleBot, BingBot, etc.)
  • Rich Dashboard - Interactive charts for devices, browsers, OS, geographic distribution
  • Date Range Filtering - View analytics for today, last 7/30/90 days, or all time
  • Referrer Tracking - See where visitors are coming from
  • CSV/JSON Export - Export comprehensive analytics including device and geo data
  • Privacy-First - IP hashing with salt, optional subnet masking, GDPR-friendly
  • Performance Caching - File or Redis caching for device detection results
  • Automatic Cleanup - Configurable retention period (0-3650 days)

QR Code Generation

  • Automatic QR code generation for every shortlink
  • Customizable colors, sizes, and styles (square, rounded, dots)
  • Logo overlay support
  • Multiple formats (PNG, SVG)
  • Downloadable QR codes
  • File or Redis caching for performance

Advanced Features

  • Link expiration with custom redirect URLs
  • Configurable HTTP status codes (301, 302, 307, 308)
  • Reserved codes protection
  • IP anonymization for GDPR compliance
  • Multi-site support
  • Database-backed settings
  • Config file overrides
  • Comprehensive logging

Redirect Manager Integration (Optional)

  • Automatic redirect creation when shortlink slugs change
  • Centralized redirect management - view all redirects in one place
  • Analytics tracking - track how many people access old shortlink slugs after changes
  • Smart undo detection - prevents flip-flop redirects within configurable time window (30-240 minutes)
  • Loop prevention - automatically detects and prevents circular redirects
  • Persistent redirects - slug change redirects remain active permanently
  • User notifications - shows "Redirect created" or "Slug change undone" messages

Requires: LindemannRock Redirect Manager plugin (optional)

When enabled, the plugin automatically creates permanent redirects in Redirect Manager when:

  • Slug changes: /s/summer-sale/s/fall-sale (creates redirect)
  • Slug undo: /s/test/s/test2/s/test (deletes redirect if within undo window)

Configure in: ShortLink Manager → Settings → Integrations

The undo window is configured in Redirect Manager → Settings → General → Undo Window (applies to all plugins)

SEOmatic Integration (Optional)

When SEOmatic is installed, Shortlink Manager can push click events to Google Tag Manager's data layer for tracking in GTM and Google Analytics.

Setup:

  1. Install and configure SEOmatic plugin with GTM or Google Analytics
  2. Navigate to Settings → Shortlink Manager → Integrations
  3. Enable SEOmatic Integration
  4. Select which events to track (redirects, QR scans)
  5. Customize the event prefix if needed (default: shortlink_manager)
  6. Save settings

GTM Event Structure:

Events are pushed to window.dataLayer with the following structure:

{
  event: "shortlink_manager_redirect",
  shortlink: {
    code: "ABC123",
    title: "My Shortlink",
    destination_url: "https://example.com",
    source: "qr",                 // qr or direct
    device_type: "mobile",        // mobile, tablet, desktop
    os: "iOS 17",
    browser: "Safari",
    country: "United States",
    city: "New York"
  }
}

Event Types:

  • shortlink_manager_redirect - Standard shortlink redirects
  • shortlink_manager_qr_scan - QR code scans (accessed via ?src=qr parameter)

GTM Trigger Setup:

Create triggers in Google Tag Manager to listen for these events:

  1. Trigger Type: Custom Event
  2. Event Name: shortlink_manager_redirect (or your custom prefix)
  3. Use regex matching to catch all Shortlink Manager events: shortlink_manager_.*

GA4 Event Example:

Forward Shortlink Manager events to Google Analytics 4:

Event Name: shortlink_click
Parameters:
  - link_code: {{shortlink.code}}
  - link_source: {{shortlink.source}}
  - device_type: {{shortlink.device_type}}

Configuration via Config File:

// config/shortlink-manager.php
return [
    'enabledIntegrations' => ['seomatic'],
    'seomaticTrackingEvents' => ['redirect', 'qr_scan'],
    'seomaticEventPrefix' => 'shortlink_manager',
];

Important Notes:

  • Events are only sent when analytics tracking is enabled (globally and per-link)
  • Requires SEOmatic plugin to be installed and enabled
  • GTM or Google Analytics must be configured in SEOmatic
  • Events include all analytics data Shortlink Manager already tracks
  • No additional external API calls or performance impact
  • Template-based redirect adds ~100ms delay for tracking (imperceptible to users)

Requirements

  • PHP 8.2+
  • Craft CMS 5.0+
  • LindemannRock Logging Library ^5.0 (installed automatically)
  • bacon/bacon-qr-code ^2.0 (installed automatically)
  • matomo/device-detector ^6.4 (installed automatically)

Installation

Via Composer

cd /path/to/project
composer require lindemannrock/craft-shortlink-manager
./craft plugin/install shortlink-manager

Using DDEV

cd /path/to/project
ddev composer require lindemannrock/craft-shortlink-manager
ddev craft plugin/install shortlink-manager

Via Control Panel

In the Control Panel, go to Settings → Plugins and click "Install" for ShortLink Manager.

⚠️ Required Post-Install Step

IMPORTANT: After installation, you MUST generate the IP hash salt for analytics to work:

php craft shortlink-manager/security/generate-salt

What happens if you skip this:

  • ❌ Analytics tracking will fail with error: IP hash salt not configured
  • ❌ Shortlinks will still redirect, but won't track clicks
  • ✅ You can generate the salt later, but no analytics will be collected until you do

Quick Start:

# After plugin installation:
php craft shortlink-manager/security/generate-salt

# The command will automatically add SHORTLINK_MANAGER_IP_SALT to your .env file
# Copy this value to staging/production .env files manually

Optional: Copy Config File

cp vendor/lindemannrock/craft-shortlink-manager/src/config.php config/shortlink-manager.php

Important: IP Privacy Protection

ShortLink Manager uses privacy-focused IP hashing with a secure salt:

  • Rainbow-table proof - Salted SHA256 prevents pre-computed attacks
  • Unique visitor tracking - Same IP = same hash
  • Geo-location preserved - Country/city extracted BEFORE hashing
  • Maximum privacy - Original IPs never stored, unrecoverable

Setup Instructions:

  1. Generate salt: php craft shortlink-manager/security/generate-salt
  2. Command automatically adds SHORTLINK_MANAGER_IP_SALT to your .env file
  3. Manually copy the salt value to staging/production .env files
  4. Never regenerate the salt in production

How It Works:

  • Plugin automatically reads salt from .env (no config file needed!)
  • Config file can override if needed: 'ipHashSalt' => App::env('SHORTLINK_MANAGER_IP_SALT')
  • If no salt found, error banner shown in settings

Security Notes:

  • Never commit the salt to version control
  • Store salt securely (password manager recommended)
  • Use the SAME salt across all environments (dev, staging, production)
  • Changing the salt will break unique visitor tracking history

Local Development: Analytics Location Override

When running locally (DDEV, localhost), analytics will default to Dubai, UAE because local IPs can't be geolocated. To set your actual location for testing:

Option 1: Config File (recommended for project-wide default)

// config/shortlink-manager.php
return [
    'defaultCountry' => 'US',
    'defaultCity' => 'New York',
];

Option 2: Environment Variable (recommended for per-environment control)

# .env
SHORTLINK_MANAGER_DEFAULT_COUNTRY=US
SHORTLINK_MANAGER_DEFAULT_CITY=New York

Fallback Priority:

  1. Config file setting
  2. .env variable
  3. Hardcoded default: Dubai, UAE

Supported locations:

  • US: New York, Los Angeles, Chicago, San Francisco
  • GB: London, Manchester
  • AE: Dubai, Abu Dhabi (default: Dubai)
  • SA: Riyadh, Jeddah
  • DE: Berlin, Munich
  • FR: Paris
  • CA: Toronto, Vancouver
  • AU: Sydney, Melbourne
  • JP: Tokyo
  • SG: Singapore
  • IN: Mumbai, Delhi

Important: This setting is safe to use in all environments (dev, staging, production). It only affects private/local IP addresses (127.0.0.1, 192.168.x.x, 10.x.x.x, etc.). Real visitor IPs in production will always use actual geolocation from ip-api.com. This means you can safely commit config file settings without impacting production analytics.

Multi-Site Management

ShortLink Manager supports restricting functionality to specific sites in multi-site installations.

Site Selection

Configure which sites ShortLink Manager should be enabled for:

Via Control Panel:

  • Go to Settings → Plugins → ShortLink Manager → General
  • Under "Site Settings", check the sites where ShortLink Manager should be available
  • Leave empty to enable for all sites

Via Configuration File:

// config/shortlink-manager.php
return [
    'enabledSites' => [1, 2], // Only enable for sites 1 and 2

    // Environment-specific overrides
    'dev' => [
        'enabledSites' => [1], // Only main site in development
    ],
    'production' => [
        'enabledSites' => [1, 2, 3], // All sites in production
    ],
];

Behavior:

  • CP Navigation: ShortLink Manager only appears in sidebar for enabled sites
  • Site Switcher: Only enabled sites appear in the site dropdown
  • Access Control: Direct access to disabled sites returns 403 Forbidden
  • Frontend Redirects: Shortlink URLs on disabled sites redirect to 404 URL
  • Entry Sidebar: Shortlink info hidden on disabled sites
  • Field Display: Shows "ShortLink is not enabled for this site" message
  • Backwards Compatibility: Empty selection enables all sites

Important Notes:

  • If the primary site is not included in enabledSites, ShortLink Manager will not appear in the main CP navigation at all, as the navigation uses the primary site context. Ensure you include your primary site ID if you want ShortLink Manager accessible from the main menu.
  • You can still access ShortLink Manager on enabled non-primary sites via direct URLs, but the main navigation will be hidden.
  • Shortlinks are global across sites (one shortlink works on all enabled sites), but the plugin can be disabled per-site for complete isolation.

Per-Site Translatable Destinations

Shortlink destinations are translatable per site, allowing different content for each language/site:

Shortlink Type Destination Behavior
Manual (created in CP) Each site can have its own destination URL or element (Entry/Category/Asset)
Auto (field-managed) Same element across all sites, but URLs are resolved per-site from the element

Example: A manual shortlink /s/promo can redirect to:

  • English site → /en/summer-sale (Entry)
  • Arabic site → /ar/custom-landing (custom URL)
  • French site → A specific Asset (PDF)

Custom Short Domain

If you want to use a dedicated short domain (e.g., short.example.com/s/abc123 instead of example.com/s/abc123), you can leverage Craft's multi-site feature.

Note: The URL prefix (e.g., /s/) is always required. A custom short domain changes the domain portion, not the URL structure.

Setup

  1. Create a dedicated site in Craft CP (Settings → Sites):

    Site Handle Base URL
    Main Site default https://example.com
    Short URLs short https://short.example.com
  2. Configure DNS to point short.example.com to your server

  3. Configure your web server (nginx/Apache) to route the domain to Craft

  4. Enable ShortLink Manager for the Short URLs site in Settings → Plugins → ShortLink Manager → General

  5. Create shortlinks and select the "Short URLs" site

Shortlinks will automatically use the site's base URL:

  • https://short.example.com/s/abc123

Multi-Language Short Domains

For multi-language sites, create a short URL site for each language:

Site Handle Base URL
Main Site (EN) en https://example.com
Main Site (AR) ar https://ar.example.com
Short URLs (EN) short-en https://short.example.com
Short URLs (AR) short-ar https://ar.short.example.com

Each shortlink is created on the appropriate short URL site for its language.

How It Works

  • Shortlinks are assigned to a site (via siteId)
  • getUrl() uses that site's base URL automatically
  • Edit shortlinks from any CP domain (e.g., example.com/admin)
  • Shortlink URLs use the assigned site's domain
  • No special configuration needed beyond standard Craft multi-site setup

Important Limitations

ShortLink Field Compatibility

The ShortLink field only works on sites where ShortLink Manager is enabled. This means:

Setup ShortLink Field Manual Creation
ShortLink Manager enabled on main sites ✓ Works ✓ Works
ShortLink Manager enabled only on short URL site ✗ Does not work ✓ Works

Why? The ShortLink field creates shortlinks on the entry's site. If ShortLink Manager is not enabled for that site, the field cannot create shortlinks.

Recommendation:

  • If you need the ShortLink field, enable ShortLink Manager on all sites where entries will use the field
  • If you only want custom short domain URLs, create shortlinks manually in the Control Panel on the short URL site

Planning Ahead

⚠️ Plan your site structure before creating shortlinks. Changing site configuration after shortlinks are in use can cause issues:

Action Consequence
Disable a shortlink site Existing shortlinks on that site stop redirecting
Delete a shortlink site Shortlinks are orphaned, URLs become dead
Printed QR codes Already distributed materials point to non-working URLs

Best Practice: Decide on your shortlink site structure before launch and avoid disabling sites with active shortlinks.

Per-Site Destinations

When using dedicated short URL sites, remember that destinations are per-site:

  • A shortlink on short.example.com needs its destination URL set for that site
  • If linking to an entry, ensure the entry exists on the short URL site, or set a custom URL
  • For multi-language, you need separate short URL sites (one per language) to have language-specific destinations

Usage

Creating Shortlinks via Control Panel

  1. Navigate to ShortLink ManagerLinks
  2. Click New shortlink
  3. Choose between auto-generated code or custom vanity URL
  4. Enter destination URL
  5. Configure options (HTTP code, expiration, QR codes, analytics)
  6. Save

Creating Shortlinks via Twig

Get or create for an element:

{% set link = craft.shortLinkManager.get({ element: entry }) %}
{{ link.getUrl() }}

Create a custom vanity URL:

{% set link = craft.shortLinkManager.create({
  code: 'pricing',
  url: 'https://example.com/pricing',
  type: 'vanity',
  httpCode: 301
}) %}

QR Code Methods:

{# 1. Get QR code URL - Returns URL string (most efficient for templates) #}
link.getQrCodeUrl()
link.getQrCodeUrl({size: 500, color: 'FF0000', bg: '00FF00'})

{# 2. Get QR code as data URI - Returns base64 data URI (for inline/email) #}
link.getQrCodeDataUri()
link.getQrCodeDataUri({size: 300})

{# 3. Get QR code binary data - Returns PNG/SVG bytes (for downloads/API) #}
link.getQrCode()
link.getQrCode({format: 'svg'})

{# Get QR code display page URL #}
link.getQrCodeDisplayUrl()

{# Render SEOmatic tracking script (returns Twig\Markup or null) #}
link.renderSeomaticTracking('qr_scan')
{# Event types: 'direct_click' for redirect pages, 'qr_scan' for QR code pages #}

QR Code Method Usage:

  • Use getQrCodeUrl() for regular templates (browser fetches image via URL)
  • Use getQrCodeDataUri() for emails or when you need inline base64 data
  • Use getQrCode() when you need raw binary data (downloads, API responses, file saving)

QR Code Options:

  • size: Image size in pixels (100-4096)
  • color: Foreground hex color (without #)
  • bg: Background hex color (without #)
  • format: 'png' or 'svg'
  • margin: Quiet zone around QR code (0-10)
  • eyeColor: Custom color for position markers
  • logo: Asset ID for logo overlay

All options are optional and fall back to the shortlink's settings or global defaults.

Frontend QR Code URLs:

Two URL patterns for QR codes:

  1. QR Code Image (direct PNG/SVG):

    /s/qr/{code}
    Example: /s/qr/abc123
    

    Returns just the image (for embedding, emails, APIs)

  2. QR Code Page (branded template):

    /s/qr/{code}/view
    Example: /s/qr/abc123/view
    

    Returns full HTML page with SEO, branding, and tracking

The QR prefix (s/qr in examples above) is configurable in Settings → General → QR Code URL Prefix. Supports both standalone (qr) and nested patterns (s/qr).

Check expiration:

{% if link.isExpired() %}
  <p>This link has expired!</p>
{% endif %}

Using the ShortLink Field

  1. Create a new field of type "Short Link"
  2. Add it to your entry type
  3. Configure field settings:
    • Link Type: Auto-generated or Custom Vanity URL
    • Default HTTP Code: 301, 302, 307, or 308
  4. Editors can now add shortlinks directly in entries
  5. Shortlink info appears in the entry sidebar (URL, status, QR code, etc.)
  6. Auto-generated codes can be regenerated in ShortLink Manager
  7. Destination URL is automatically synced from the entry's URL

Configuration

Config File

Create a config/shortlink-manager.php file to override default settings:

cp vendor/lindemannrock/craft-shortlink-manager/src/config.php config/shortlink-manager.php

Example configuration:

return [
    'pluginName' => 'ShortLink Manager',

    // Site settings
    'enabledSites' => [],  // Array of site IDs (empty = all sites)

    // URL settings
    'slugPrefix' => 's',
    'qrPrefix' => 's/qr',  // QR code URL prefix (standalone or nested like 's/qr')
    'codeLength' => 8,

    // QR Code settings
    'defaultQrSize' => 256,
    'defaultQrColor' => '#000000',
    'defaultQrBgColor' => '#FFFFFF',

    // Cache settings
    'cacheStorageMethod' => 'file',  // 'file' or 'redis'
    'enableQrCodeCache' => true,
    'qrCodeCacheDuration' => 86400,  // 24 hours
    'cacheDeviceDetection' => true,
    'deviceDetectionCacheDuration' => 3600,  // 1 hour

    // Template settings
    'redirectTemplate' => null,  // e.g., 'shortlink-manager/redirect'
    'expiredTemplate' => null,   // e.g., 'shortlink-manager/expired'
    'qrTemplate' => null,        // e.g., 'shortlink-manager/qr'

    // Analytics settings
    'enableAnalytics' => true,
    'analyticsRetention' => 90, // days
    'enableGeoDetection' => false,  // Track visitor location
    'anonymizeIpAddress' => false,  // Subnet masking for privacy

    // Redirect settings
    'defaultHttpCode' => 301,
    'notFoundRedirectUrl' => '/',

    // Integrations (optional)
    'enabledIntegrations' => ['seomatic', 'redirect-manager'],  // Enable integrations

    // SEOmatic Integration
    'seomaticTrackingEvents' => ['redirect', 'qr_scan'],  // Event types to track
    'seomaticEventPrefix' => 'shortlink_manager',  // GTM event prefix

    // Redirect Manager Integration
    'redirectManagerEvents' => ['slug-change'],  // Which events create redirects
    // Available events: 'slug-change'
    // Examples:
    // ['slug-change'] - Slug changes create redirects (recommended)
    // [] - Integration enabled but no redirects created

    // Display
    'itemsPerPage' => 50,
];

See Configuration Documentation for all available options.

Custom Template Paths

ShortLink Manager uses templates for redirect pages, expired links, and QR code display pages.

Default Template Paths

When template settings are not configured (set to null), the plugin uses its built-in templates:

  • Redirect page: plugins/shortlink-manager/src/templates/redirect.twig
  • Expired page: plugins/shortlink-manager/src/templates/expired.twig
  • QR code page: plugins/shortlink-manager/src/templates/qr.twig

Quick Start: Copy Example Templates

To customize templates, copy them to your project's templates/ directory:

# Create templates directory
mkdir -p templates/shortlink-manager

# Copy example templates
cp vendor/lindemannrock/craft-shortlink-manager/src/templates/redirect.twig templates/shortlink-manager/
cp vendor/lindemannrock/craft-shortlink-manager/src/templates/expired.twig templates/shortlink-manager/
cp vendor/lindemannrock/craft-shortlink-manager/src/templates/qr.twig templates/shortlink-manager/

# Customize the templates to match your site's design

Configure Custom Template Paths

Via Config File:

// config/shortlink-manager.php
return [
    'redirectTemplate' => 'my-custom/redirect',
    'expiredTemplate' => 'my-custom/expired',
    'qrTemplate' => 'my-custom/qr-display',
];

Via Control Panel:

  • Settings → General → Template Settings

Integration Settings

Enabled Integrations (enabledIntegrations):

  • Array of plugin handles to integrate with
  • Current options: ['seomatic', 'redirect-manager']
  • Leave empty [] to disable all integrations

SEOmatic Integration Settings:

SEOmatic Tracking Events (seomaticTrackingEvents):

  • Array of event types to track
  • 'redirect' - Standard shortlink redirects
  • 'qr_scan' - QR code scans (via ?src=qr parameter)
  • Example: ['redirect', 'qr_scan'] - Track both event types

SEOmatic Event Prefix (seomaticEventPrefix):

  • String prefix for GTM event names (lowercase, numbers, underscores only)
  • Default: 'shortlink_manager'
  • Creates events like shortlink_manager_redirect, shortlink_manager_qr_scan
  • Example: 'my_brand' creates my_brand_redirect, my_brand_qr_scan

Redirect Manager Integration Settings:

Redirect Manager Events (redirectManagerEvents):

  • Array of events that trigger redirect creation
  • 'slug-change' - Creates redirect when shortlink slug changes
  • Example: ['slug-change'] - Slug changes create redirects (recommended)

Environment-Specific Configuration

return [
    '*' => [
        'enableAnalytics' => true,
    ],
    'dev' => [
        'analyticsRetention' => 30,
        'cacheStorageMethod' => 'file',
        'cacheDeviceDetection' => false,  // Disable cache in dev for testing
    ],
    'production' => [
        'analyticsRetention' => 365,
        'cacheStorageMethod' => 'redis',  // Use Redis in production (Servd/AWS/Platform.sh)
        'enableGeoDetection' => true,
        'cacheDeviceDetection' => true,
    ],
];

Permissions

  • View shortlinks: Can view shortlinks in CP
  • Create shortlinks: Can create new shortlinks
  • Edit shortlinks: Can edit existing shortlinks
  • Delete shortlinks: Can delete shortlinks
  • View analytics: Can view analytics dashboard
  • Export analytics: Can export analytics data
  • View logs: Can view plugin logs
  • Manage settings: Can change plugin settings

API Reference

ShortLink Model

Properties:

  • id - ShortLink ID
  • code - The short code
  • destinationUrl - Target URL
  • enabled - Active status
  • expiresAt - Expiration date/time
  • hits - Click count

Methods:

  • getUrl() - Get full shortlink URL
  • getQrCode(options) - Get QR code binary data
  • getQrCodeDataUri(options) - Get QR code as data URI
  • isExpired() - Check if expired
  • getElement() - Get linked element
  • getAnalytics(filters) - Get analytics data

Twig Variable

{# Get shortlink #}
craft.shortLinkManager.get({ code: 'abc123' })
craft.shortLinkManager.get({ id: 5 })
craft.shortLinkManager.get({ element: entry })

{# Create shortlink #}
craft.shortLinkManager.create({ url: '...', type: 'code' })

{# Get analytics #}
craft.shortLinkManager.getAnalytics(linkId, { days: 30 })

{# Get all shortlinks #}
craft.shortLinkManager.getAll({ enabled: true, limit: 10 })

Events

The plugin triggers several events you can listen to:

use lindemannrock\shortlinkmanager\ShortLinkManager;

Event::on(
    ShortLinkManager::class,
    ShortLinkManager::EVENT_BEFORE_SAVE_SHORTLINK,
    function(ShortLinkEvent $event) {
        // Modify $event->shortLink before save
    }
);

Logging

ShortLink Manager uses the LindemannRock Logging Library for centralized logging.

Log Levels

  • Error: Critical errors only (default)
  • Warning: Errors and warnings
  • Info: General information
  • Debug: Detailed debugging (includes performance metrics, requires devMode)

Configuration

// config/shortlink-manager.php
return [
    'logLevel' => 'error', // error, warning, info, or debug
];

Note: Debug level requires Craft's devMode to be enabled. If set to debug with devMode disabled, it automatically falls back to info level.

Log Files

  • Location: storage/logs/shortlink-manager-YYYY-MM-DD.log
  • Retention: 30 days (automatic cleanup via Logging Library)
  • Format: Structured JSON logs with context data
  • Web Interface: View and filter logs in CP at ShortLink Manager → Logs

Log Management

Access logs through the Control Panel:

  1. Navigate to ShortLink Manager → Logs
  2. Filter by date, level, or search terms
  3. Download log files for external analysis
  4. View file sizes and entry counts
  5. Auto-cleanup after 30 days (configurable via Logging Library)

Requires: lindemannrock/craft-logging-library plugin (installed automatically as dependency)

See docs/LOGGING.md for detailed logging documentation.

Support

License

This plugin is licensed under the MIT License. See LICENSE for details.

Credits

Created by LindemannRock