Skip to content

Logging & Diagnostics ​

AppPorts has a built-in logging system that records key events, migration operations, system information, and error details during app runtime. When issues arise, you can export a diagnostic package and submit it to the project Issues for troubleshooting.

Logged Content ​

Startup Session Information ​

The following information is recorded each time the app starts:

ItemDescription
Session IDUnique identifier for this run (8-character UUID prefix)
Process IDSystem process identifier
Bundle IDApp identifier
App LanguageCurrently selected language code
System LocaleSystem locale identifier
TimezoneCurrent timezone identifier
Preferred Language ListSystem preferred language order

System Diagnostic Information ​

ItemDescription
App VersionVersion number and build number
macOS VersionSystem version and marketing name (e.g., "macOS Sequoia 15.x")
Device ModelModel and friendly name (e.g., "MacBook Pro (14-inch, M3 Pro, 2023)")
Processor InfoBrand string, core count, active core count
Physical MemoryTotal memory

External Storage Information ​

Recorded when selecting an external storage volume:

ItemDescription
Volume NameStorage volume name
Total Capacity / Available SpaceStorage space information
File System Formate.g., APFS, HFS+, exFAT, etc.
Interface ProtocolUSB, Thunderbolt, NVMe/SATA
Device SpeedTransfer rate information
Block SizeStorage block size
Volume UUIDStorage volume unique identifier

Migration Operation Events ​

Each migration operation generates a unique operation ID (e.g., data-migrate-ABCD1234), recording:

  • Operation start and end
  • Progress of each step (copy, delete original directory, create symbolic link, rollback)
  • Path state snapshots before and after steps (existence, permissions, size, symlink target, immutable flag)
  • Residual migration data detection and auto-recovery
  • File copy progress, errors, and retries

Migration Performance Reports ​

ItemDescription
App NameMigrated app name
Data SizeMigrated data volume
DurationMigration duration (seconds)
Transfer SpeedTransfer rate (MB/s)
Source Path / Destination PathMigration start and end paths

Error Details ​

Error logs contain structured information:

FieldDescription
Error DescriptionHuman-readable error description
Error Type / Domain / CodeNSError structured information
Error CodeAppPorts internal error code (see table below)
Failure ReasonDetailed failure reason
Recovery SuggestionSystem-provided recovery suggestion
File PathAffected file path
Related PathsRelated app paths involved in the operation (relatedURLs)
Underlying ErrorNested error recorded recursively

Error Codes ​

Error CodeMeaning
BACKUP-SIGNATURE-FAILEDSignature backup failed
APP-MOVE-DESTINATION-CONFLICTApp migration target already exists and cannot be confirmed safe to replace
APP-RESTORE-LOCAL-CONFLICTMove-back found a same-name local item that cannot be overwritten automatically
DATA-MIGRATE-DESTINATION-CONFLICTData migration target already exists and metadata does not fully match
RESIGN-FAILEDRe-signing failed (app may not pass macOS signature verification)
DATA-RESIGN-FAILEDAuto-re-signing after data directory migration failed
RESIGN-REFUSED-SANDBOXEDRe-signing a sandboxed app was refused
RESTORE-SIGNATURE-IDENTITY-UNAVAILABLEThe original signing certificate is not on this Mac; restoration was refused
CONTAINER-MOUNT-*A mount migration stage failed, for example CONTAINER-MOUNT-EXTERNAL-NOT-APFS or CONTAINER-MOUNT-SWITCH-FAILED
CONTAINER-RESTORE-*A stage of restoring a mount-migrated directory failed
DATA-BACKUP-SIGNATURE-FAILEDSignature backup before data directory migration failed (original signature cannot be restored later)

Data Directory Operation Context ​

Data directory operations (migration, restore, normalization, relinking) automatically include associated app context information in logs:

FieldDescription
app_nameAssociated app name
app_statusApp status (Linked, Local, etc.)
app_is_resignedWhether the app has been re-signed
app_bundle_idApp's Bundle ID (read from real path)
app_real_pathApp's real external path

Operation Summary ​

Each migration operation generates an OperationSummaryRecord, retaining the most recent 100 records:

FieldDescription
operationIDOperation unique identifier
categoryOperation category (app_move, data-migrate, file-copy, etc.)
resultResult (success, failed, rolled_back, success_with_warning)
errorCodeError code (if any)
startedAt / endedAtStart and end time
durationMsDuration (milliseconds)

Log Configuration ​

Storage Location ​

Default log path:

text
~/Library/Application Support/AppPorts/AppPorts_Log.txt

Can be customized via:

  • Menu bar → Logs → Set Log Location
  • Settings → Logging Settings → Custom Path

Log Format ​

text
[2026-05-08 09:30:00] [INFO] [session:a1b2c3d4] [pid:12345] 应用启动
[2026-05-08 09:30:01] [DIAG] [session:a1b2c3d4] [pid:12345]   app_version: 1.6.1 (123)
[2026-05-08 09:30:05] [PERF] [session:a1b2c3d4] [pid:12345]   迁移完成: 2.3 GB, 45.2 MB/s, 52.1s

Log Levels ​

LevelDescription
INFOGeneral information
ERRORError information (with structured error details)
DIAGSystem diagnostic information
DISKExternal storage volume information
PERFMigration performance report
TRACELow-level path state and folder monitoring
DEBUGDebug information (size calculation, nested directory checks)
WARNWarnings (residual migration data, recovery mode)

Log Rotation ​

  • Default max size: 2 MB (configurable: 1 MB, 5 MB, 10 MB, 50 MB, 100 MB)
  • Auto-truncation when exceeded: Discards older half of lines, keeps newer half

Export Diagnostic Package ​

When issues arise requiring feedback, please export a diagnostic package and attach it to the Issue.

Export Methods ​

Method 1: Menu Bar

  1. Click Menu bar → Logs → Export Diagnostic Package
  2. Choose save location
  3. System automatically generates a .zip file and opens in Finder

Method 2: Settings Page

  1. Open AppPorts → Settings (upper right corner)
  2. Find the "Logging Settings" section
  3. Click "Export Diagnostic Package" button
  4. Choose save location

Diagnostic Package Contents ​

The exported AppPorts-Diagnostic-<datetime>.zip contains:

FileFormatDescription
diagnostic-summary.jsonJSONMetadata (session ID, version, locale, timezone, etc.)
diagnostic-summary.txtPlain textHuman-readable diagnostic summary
recent-operations.jsonJSONMost recent 100 operation records
recent-failures.jsonJSONMost recent 20 failed/warning operations
AppPorts_Log.share-safe.txtPlain textComplete log (redacted)

Privacy Protection ​

Log files in the diagnostic package are redacted:

Original ContentReplaced With
User home directory path (e.g., /Users/john)/Users/<redacted-user>
External storage volume name (e.g., /Volumes/MyDrive)/Volumes/<redacted-volume>
$HOME full path~

Submitting Issues ​

After obtaining the diagnostic package, follow these steps to submit:

  1. Visit the project Issues page
  2. Click "New Issue," select the Bug report template
  3. Describe the issue and reproduction steps
  4. Drag the diagnostic .zip file to the attachment area to upload
  5. Submit the Issue

💡 Improve Feedback Efficiency

Submitting Issues with diagnostic packages can significantly speed up issue resolution. The diagnostic package contains complete operation history, error details, and system environment information, allowing developers to reproduce and analyze issues without repeated communication.

最近更新