PHPackages                             tourze/wechat-mini-program-log-bundle - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Logging &amp; Monitoring](/categories/logging)
4. /
5. tourze/wechat-mini-program-log-bundle

ActiveSymfony-bundle[Logging &amp; Monitoring](/categories/logging)

tourze/wechat-mini-program-log-bundle
=====================================

微信小程序日志管理Bundle，提供错误日志、反馈和处罚记录的同步和管理功能

0.0.2(5mo ago)00MITPHPCI failing

Since Nov 5Pushed 4mo ago1 watchersCompare

[ Source](https://github.com/tourze/wechat-mini-program-log-bundle)[ Packagist](https://packagist.org/packages/tourze/wechat-mini-program-log-bundle)[ RSS](/packages/tourze-wechat-mini-program-log-bundle/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (2)Dependencies (39)Versions (3)Used By (0)

Wechat Mini Program Log Bundle
==============================

[](#wechat-mini-program-log-bundle)

[![Latest Version](https://camo.githubusercontent.com/b92076bf9e0e3d6bda7c30fbf3a2a6de1d325c57f7bf9c835f796304dab1c1d3/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f746f75727a652f7765636861742d6d696e692d70726f6772616d2d6c6f672d62756e646c652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/tourze/wechat-mini-program-log-bundle)[![PHP Version](https://camo.githubusercontent.com/cc9cdea9aa96b40a822425e981b0a030e3371202973c7d57b74e8e99834f81dc/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7068702d253545382e312d626c7565)](https://php.net)[![License](https://camo.githubusercontent.com/f8df3091bbe1149f398a5369b2c39e896766f9f6efba3477c63e9b4aa940ef14/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d677265656e)](LICENSE)[![Build Status](https://camo.githubusercontent.com/b0c6c6845a74cb65a7f0a32bdcfd8fbf80eeb40026c4029af424ab371c94b8bd/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6275696c642d70617373696e672d627269676874677265656e)](https://github.com/tourze/php-monorepo)[![Code Coverage](https://camo.githubusercontent.com/32855e94577df9d0a30995653b17d33a5fbfdf644518f96ea0374313397d19b7/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f636f7665726167652d3130302532352d627269676874677265656e)](https://github.com/tourze/php-monorepo)[![Total Downloads](https://camo.githubusercontent.com/d51351b225f119f4e26d810a40388329b8a433910a46535b69b24797f33a4b04/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f746f75727a652f7765636861742d6d696e692d70726f6772616d2d6c6f672d62756e646c652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/tourze/wechat-mini-program-log-bundle)

[English](README.md) | [中文](README.zh-CN.md)

A Symfony bundle for managing WeChat Mini Program logs, including error tracking, feedback collection, and penalty management.

Table of Contents
-----------------

[](#table-of-contents)

- [Features](#features)
- [Installation](#installation)
- [Quick Start](#quick-start)
- [Configuration](#configuration)
- [Dependencies](#dependencies)
- [Commands](#commands)
- [Entities](#entities)
- [Advanced Usage](#advanced-usage)
- [Security](#security)
- [Automated Scheduling](#automated-scheduling)
- [License](#license)

Features
--------

[](#features)

- **Error Tracking**: Monitor and collect JavaScript errors from WeChat Mini Programs
- **Feedback Management**: Collect and manage user feedback from mini programs
- **Penalty Monitoring**: Track transaction experience score violations
- **Automated Synchronization**: Scheduled commands for data synchronization
- **Entity Management**: Doctrine entities for structured data storage

Installation
------------

[](#installation)

```
composer require tourze/wechat-mini-program-log-bundle
```

Quick Start
-----------

[](#quick-start)

### 1. Register the Bundle

[](#1-register-the-bundle)

Add the bundle to your `config/bundles.php`:

```
return [
    // ...
    WechatMiniProgramLogBundle\WechatMiniProgramLogBundle::class => ['all' => true],
];
```

### 2. Configure Services

[](#2-configure-services)

The bundle automatically registers its services. Make sure you have the required dependencies installed.

### 3. Database Setup

[](#3-database-setup)

Create and run migrations for the entity tables:

```
php bin/console make:migration
php bin/console doctrine:migrations:migrate
```

Configuration
-------------

[](#configuration)

The bundle uses the WeChat Mini Program API client from `tourze/wechat-mini-program-bundle`. Ensure your WeChat accounts are properly configured with valid API credentials.

Example configuration in `config/packages/wechat_mini_program.yaml`:

```
wechat_mini_program:
    accounts:
        default:
            app_id: 'your_app_id'
            app_secret: 'your_app_secret'
```

Dependencies
------------

[](#dependencies)

This bundle requires the following packages:

- PHP 8.1 or higher
- Symfony 6.4 or higher
- `tourze/wechat-mini-program-bundle ^0.1` - WeChat Mini Program API client
- `tourze/doctrine-timestamp-bundle ^0.0` - Timestamp management
- `tourze/doctrine-snowflake-bundle ^0.1` - Snowflake ID generation
- `tourze/enum-extra ^0.1` - Enhanced enum functionality
- `tourze/symfony-cron-job-bundle ^0.1` - Automated task scheduling

Commands
--------

[](#commands)

The bundle provides four console commands for data synchronization:

### Error Management

[](#error-management)

```
# Synchronize error list from WeChat API
php bin/console wechat-mini-program:sync-get-error-list

# Synchronize error details from WeChat API
php bin/console wechat-mini-program:sync-get-error-detail
```

### Feedback Collection

[](#feedback-collection)

```
# Collect user feedback from mini programs
php bin/console wechat-mini-program:get-feedback
```

### Penalty Monitoring

[](#penalty-monitoring)

```
# Monitor transaction experience score violations
php bin/console wechat-mini-program:get-penalty
```

Entities
--------

[](#entities)

The bundle includes several entities for data management:

- `ErrorDetail`: Detailed JavaScript error information
- `ErrorListData`: Aggregated error statistics
- `Feedback`: User feedback data
- `PenaltyList`: Transaction violation records

Advanced Usage
--------------

[](#advanced-usage)

### Custom Repository Usage

[](#custom-repository-usage)

```
use WechatMiniProgramLogBundle\Repository\ErrorDetailRepository;

class MyService
{
    public function __construct(
        private ErrorDetailRepository $errorDetailRepository
    ) {}

    public function findRecentErrors(): array
    {
        return $this->errorDetailRepository->findBy(
            ['date' => new \DateTime('-7 days')],
            ['createTime' => 'DESC'],
            10
        );
    }
}
```

### Event Listeners

[](#event-listeners)

Register custom event listeners to handle error data:

```
use Symfony\Component\EventDispatcher\EventSubscriberInterface;

class ErrorEventSubscriber implements EventSubscriberInterface
{
    public static function getSubscribedEvents(): array
    {
        return [
            'wechat.error.created' => 'onErrorCreated',
        ];
    }

    public function onErrorCreated(ErrorEvent $event): void
    {
        // Custom error handling logic
    }
}
```

Security
--------

[](#security)

### Data Validation

[](#data-validation)

All entities include comprehensive validation constraints to ensure data integrity:

- String length limits prevent database overflow
- Type validation ensures proper data types
- Enum validation restricts values to valid choices

### Access Control

[](#access-control)

The bundle does not include built-in access control. Implement appropriate security measures in your application:

- Use Symfony Security component for authentication
- Implement proper authorization checks
- Validate API credentials securely

### Sensitive Data

[](#sensitive-data)

Be aware that this bundle processes:

- User feedback data
- Error information that may contain sensitive details
- OpenID identifiers

Ensure compliance with relevant data protection regulations.

Automated Scheduling
--------------------

[](#automated-scheduling)

All commands are configured with cron expressions for automated execution:

- Error list sync: Daily at 3:06 AM and 11:35 AM
- Error detail sync: Daily at 4:02 AM and 8:22 AM
- Feedback collection: Hourly at 15 minutes past
- Penalty monitoring: Daily at 1:40 AM and 1:45 PM

Contributing
------------

[](#contributing)

We welcome contributions! Please see our [contributing guidelines](../../CONTRIBUTING.md) for details on:

- How to submit issues
- How to submit pull requests
- Code style requirements
- Testing requirements

License
-------

[](#license)

This bundle is under the MIT license. See the complete license in the bundle:

[LICENSE](LICENSE)

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance77

Regular maintenance activity

Popularity0

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity26

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~8 days

Total

2

Last Release

177d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/e354fdb316da535dfa8ba2e9193a473c403b6bc6fb9170778d1dc50e304c6e9d?d=identicon)[tourze](/maintainers/tourze)

---

Top Contributors

[![tourze](https://avatars.githubusercontent.com/u/13899502?v=4)](https://github.com/tourze "tourze (2 commits)")

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Type Coverage Yes

### Embed Badge

![Health badge](/badges/tourze-wechat-mini-program-log-bundle/health.svg)

```
[![Health](https://phpackages.com/badges/tourze-wechat-mini-program-log-bundle/health.svg)](https://phpackages.com/packages/tourze-wechat-mini-program-log-bundle)
```

###  Alternatives

[sylius/sylius

E-Commerce platform for PHP, based on Symfony framework.

8.4k5.6M647](/packages/sylius-sylius)[contao/core-bundle

Contao Open Source CMS

1231.6M2.3k](/packages/contao-core-bundle)[ec-cube/ec-cube

EC-CUBE EC open platform.

78527.0k1](/packages/ec-cube-ec-cube)[sulu/sulu

Core framework that implements the functionality of the Sulu content management system

1.3k1.3M152](/packages/sulu-sulu)[open-dxp/opendxp

Content &amp; Product Management Framework (CMS/PIM)

7310.3k29](/packages/open-dxp-opendxp)[prestashop/prestashop

PrestaShop is an Open Source e-commerce platform, committed to providing the best shopping cart experience for both merchants and customers.

9.0k15.4k](/packages/prestashop-prestashop)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
