承接 de-swebhosting-flow-package/databaselog 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

de-swebhosting-flow-package/databaselog

最新稳定版本:v0.1.0

Composer 安装命令:

composer require de-swebhosting-flow-package/databaselog

包简介

Provides a Backend for writing log entries to the database and a logger for connecting log entries with accounts and optionally partys from the party framework.

README 文档

README

Build Status

De.SWebhosting.DatabaseLog

This is a Flow framework package that brings you some logging features:

  1. You can store log messages in the database.
  2. You can search for log entries using a repository.
  3. You can store account / user information in the log entries and filter for them.

Install

If you want to use this package, you simply need to add a require statement to your composer.json file:

{
    "require": {
        "de-swebhosting-flow-package/databaselog": "~6.1"
    }
}

Hint! This package was tested with TYPO3 Flow Version 6.1 only. If you are having trouble with older versions please open an issue.

How to use it

Database backend

There are two possibilities to use the database backend for logging.

Inject databaseLogger in your objects

This package comes with a preconfigured PSR log identifier called databaseLogger. This logger only logs to the database.

You can inject it by adding the related config in your Objects.yaml:

My\Vendor\My\Class:
  properties:
    logger:
      object:
        factoryObjectName: Neos\Flow\Log\PsrLoggerFactoryInterface
        factoryMethodName: get
        arguments:
          1:
            value: databaseLogger

With this configuration the $logger poperty in your class will use the databseLogger log.

Configure backend in existing loggers

You can also add the database logger as an additional backend to existing logs or replace the default backend by ajusting the configuration in Settings.yaml:

This overwrites the i18nLogger backend with the database backend.

Neos:
  Flow:
    log:
      psr3:
        'Neos\Flow\Log\PsrLoggerFactory':
          i18nLogger:
            default:
              class: De\SWebhosting\DatabaseLog\Log\DatabaseBackend
              options:
                severityThreshold: '%LOG_INFO%'
                logIpAddress: true

To add it as additional backend, simply use another key than default:

Neos:
  Flow:
    log:
      psr3:
        'Neos\Flow\Log\PsrLoggerFactory':
          i18nLogger:
            database:
              class: De\SWebhosting\DatabaseLog\Log\DatabaseBackend
              options:
                severityThreshold: '%LOG_INFO%'
                logIpAddress: true

Log repository

You can use the \De\SWebhosting\DatabaseLog\Domain\Repository\LogEntryRepository like any other Flow repository to search for log entries. Inject it in your class and start querying.

It currently comes with a minimal selection of query methods. Please let me know if you need more.

Account action logger

A special feature of this package is the account action logger. It allows you to store log entries that are connected to an account or to a party (if the party framework is installed).

The account is passed to the logging backend in the additional data array in a parameter called De.SWebhosting.DatabaseLog.Account. If a normal backend is used, this parameter will simply be stored as a readable var dump.

If the DatabaseBackend of this package is used, the parameter will be interpreted and the account identifer and the authentication provider name will be stored in properties of the log entry model. This allows you to filter for log messages of a dedicated account.

If the party framework is installed and a party is connected to the provided account, the object identifier and the full name of the user will also be stored in the database.

统计信息

  • 总下载量: 32
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 2
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: GPL-3.0
  • 更新时间: 2015-03-04