Connector Logging Setup Guide

by Endgrate Team 2024-09-03 5 min read

Setting up connector logging is key for SaaS app maintenance and troubleshooting. Here's what you need to know:

  • Connector logging tracks events between software systems
  • It's vital for troubleshooting, monitoring, security, and compliance
  • Many systems don't have optimal logging by default

Key setup steps:

  1. Get needed permissions and access
  2. Check system requirements
  3. Find and edit config files
  4. Set appropriate log levels
  5. Configure log file locations and rotation
  6. Implement security for log data

Best practices:

  • Use ERROR and WARN sparingly
  • Keep INFO under 5% of logs
  • Use DEBUG/TRACE temporarily
  • Don't log sensitive info
  • Review settings regularly

This creates visibility into data flows, enables quick fixes, and improves security monitoring.

Level Use Impact
ERROR Major issues Low
WARN Potential problems Low-Mod
INFO Normal flow Moderate
DEBUG Diagnostics High
TRACE In-depth debugging Very High

What You Need Before Starting

Gather these essentials before setup:

Permissions and Access

  • Admin credentials
  • SSH access (for some setups)
  • Network admin account (if logs stored on network)

System Requirements

  • OS: Windows Server 2016+, Ubuntu 19.04+, CentOS 8, RHEL 7+
  • Hardware: 8+ CPU cores, 8-32 GB RAM
  • Storage: 250+ GB for 2 days of logs
  • Software: Visual C++ 2015+ (Windows), VSQL Client Driver (ArcSight)

Connector-Specific Needs

Example: ArcSight Platform 22.1.2+, ArcSight Database 11.1+

Config Files

  • Agents 10.70+: logback.xml
  • Agents 10.35-10.69: logback.xml
  • Agents 10.34 and earlier: log4j.properties

Logging Levels

Familiarize yourself with ERROR, WARN, INFO, DEBUG, and TRACE levels.

Types of Logging Levels

Logging levels control info logged:

Level Use Performance Impact
FATAL Catastrophic events Minimal
ERROR Major problems Low
WARN Potential issues Low-Moderate
INFO Normal flow Moderate
DEBUG Diagnostics High
TRACE In-depth debugging Very High

Tips:

  • Use ERROR/WARN sparingly
  • Keep INFO under 5% of logs
  • Use DEBUG/TRACE temporarily

Example: A MuleSoft app with excessive INFO logging had high CPU use. Reducing logging improved performance by 40%.

Remember:

  • Stick to INFO+ in production
  • Use DEBUG/TRACE for specific troubleshooting
  • Review logs regularly

Setting Up Basic Logging

Here's how to set up basic connector logging:

Finding Config Files

Locations vary:

  • MuleSoft: MULE_HOME/conf/log4j2.xml
  • SAS Enterprise Guide: Tools > Options > Application Logging
  • InDesign CC 2019: App's root folder

Setting Default Options

  1. Set default to INFO for production
  2. Configure log rotation
  3. Specify log file locations

MuleSoft example:

<AsyncLogger name="org.mule" level="INFO"/>  
<AsyncLogger name="com.mulesoft" level="INFO"/>

Enabling Connector Logging

  1. Create connector-specific log4j.xml
  2. Name it uniquely (e.g. [ProductName]Connector_log4j.xml)
  3. Define unique appender and logger

Example:

<appender name="MyConnector" class="org.apache.log4j.RollingFileAppender">
    <param name="File" value="&logDir;/MyConnector.log"/>
    <param name="Append" value="true"/>
    <param name="MaxFileSize" value="20MB"/>
    <param name="MaxBackupIndex" value="10"/>
    <layout class="org.apache.log4j.PatternLayout">
        <param name="ConversionPattern" value="&filePattern;"/>
    </layout>
</appender>

<logger name="com.mycompany.MyConnector">
    <level value="ERROR" />
    <appender-ref ref="MyConnector" />
</logger>

For InDesign CC 2019: Add empty LogHTTPCalls and LogHTTPState files to root folder.

Advanced Logging Setup

Fine-tune your logging:

Changing Log Locations

  1. Open config file (e.g. log4j2.xml)
  2. Find <appender> section
  3. Update <param name="File"> value

Example:

<appender name="MyConnector" class="org.apache.log4j.RollingFileAppender">
    <param name="File" value="/new/path/to/MyConnector.log"/>
    <!-- Other params -->
</appender>

Setting Up Log Rotation

Use logrotate:

  1. Create file in /etc/logrotate.d/
  2. Add config:
/path/to/your/connector.log {
    daily
    rotate 14
    compress
    missingok
    notifempty
    create 0640 user group
    postrotate
        /usr/bin/killall -HUP your_connector_process
    endscript
}

Limiting File Sizes

  1. Open config file
  2. Find <appender> section
  3. Add/update MaxFileSize and MaxBackupIndex

Example:

<appender name="MyConnector" class="org.apache.log4j.RollingFileAppender">
    <param name="MaxFileSize" value="10MB"/>
    <param name="MaxBackupIndex" value="5"/>
    <!-- Other params -->
</appender>

Testing

  1. Run: sudo logrotate /etc/logrotate.conf --debug
  2. Check for errors
  3. Restart connector/app if good
sbb-itb-96038d7

Using Detailed Logging

Use detailed logging for troubleshooting:

When to Use

  • Debugging complex issues
  • Monitoring during development
  • Investigating production problems

Enabling

  1. Find config file
  2. Locate <appender> for connector
  3. Set level to DEBUG or TRACE

Example (Salesforce):

<logger name="org.mule.extension.salesforce" level="DEBUG"/>

Connector-Specific Logging

Connector Package Name
HTTP org.mule.service.http.impl.service.HttpMessageLogger
Salesforce org.mule.extension.salesforce
FTP org.mule.extension.ftp
Database org.mule.extension.db

Best Practices

  1. Use temporarily
  2. Include context in messages
  3. Avoid logging sensitive data
  4. Use log levels wisely
  5. Monitor log size

Analyzing Logs

  • Look for patterns/errors
  • Track data flow
  • Identify bottlenecks
  • Correlate entries with events

Checking and Managing Logs

Effective log management is crucial:

Viewing Logs

  1. Go to Connectors page
  2. Find form
  3. Click Logs

Color codes:

  • Yellow: Info
  • Red: Error
  • Green: Success

Filtering Logs

Filter by:

  • Time period
  • Response ID
  • Status
  • Description

Log Retention and Storage

  1. Centralize collection
  2. Use cloud storage
  3. Set retention periods
  4. Implement rotation

Analyzing Logs

  1. Use management tools
  2. Set up alerts
  3. Look for patterns
  4. Correlate events

Security Considerations

  • Don't log sensitive data
  • Protect log data
  • Ensure high availability

Fixing Common Logging Problems

Common issues and solutions:

Permission Problems

  1. Check file ownership

  2. Change if needed:

    sudo chown -R dd-agent:dd-agent /var/log/datadog/
    
  3. Verify socket permissions

  4. Change if needed:

    chown dd-agent -R /opt/datadog-agent/run
    

Setup Errors

  1. Check for missing params
  2. Look for syntax errors
  3. Verify log paths

Large Log Files

Strategy Description Implementation
Rotation Archive/delete old logs Set up policy
Size Limits Cap file sizes Configure new file creation
Compression Reduce storage needs Enable for archives

Specific Connector Issues

Tips for Good Connector Logging

Key tips:

  • Balance detail and speed
  • Keep data safe
  • Do regular check-ups
  • Enhance log quality
  • Implement monitoring/alerts

Remember: Good logging isn't set-and-forget. Review and adjust regularly.

Wrap-up

Effective connector logging is crucial for SaaS apps. Key points:

  • Use log levels strategically
  • Customize configs
  • Balance detail and performance
  • Secure logs
  • Monitor and alert

Regular reviews and adjustments are vital. Good practices lead to:

  • Faster troubleshooting
  • Improved reliability
  • Better security/compliance

With the right strategy, logging becomes a powerful tool for maintaining and improving your SaaS apps.

FAQs

What is a log connector?

A log connector shows:

  • Connector status
  • Connection to SaaS service
  • Related messages
  • Initialization info

Key features:

Feature Description
Status Display Shows connection status
Message Logging Records related messages
Initialization Info Captures startup details
Troubleshooting Aid Helps resolve issues

Tips:

  • Review logs regularly
  • Use search/filter functions
  • Keep connectors active during errors

Related posts

Ready to get started?

Book a demo now

Book Demo