PHPackages                             zguillez/php-xmlog - 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. zguillez/php-xmlog

ActiveLibrary[Logging &amp; Monitoring](/categories/logging)

zguillez/php-xmlog
==================

PHP module for create XML and LOG files

v1.1.3(7y ago)03111MITPHP

Since Mar 12Pushed 6y ago1 watchersCompare

[ Source](https://github.com/zguillez/php-xmlog)[ Packagist](https://packagist.org/packages/zguillez/php-xmlog)[ RSS](/packages/zguillez-php-xmlog/feed)WikiDiscussions master Synced 4w ago

READMEChangelogDependenciesVersions (7)Used By (0)

php-xmlog
=========

[](#php-xmlog)

[![](https://camo.githubusercontent.com/4c31e33455a41edf10547646c436b62338f0f51b24efb1669f8d1f37c0217bc4/68747470733a2f2f7265706f73732e6865726f6b756170702e636f6d2f3f706174683d7a6775696c6c657a2f7068702d786d6c6f67)](https://camo.githubusercontent.com/4c31e33455a41edf10547646c436b62338f0f51b24efb1669f8d1f37c0217bc4/68747470733a2f2f7265706f73732e6865726f6b756170702e636f6d2f3f706174683d7a6775696c6c657a2f7068702d786d6c6f67)[![License](https://camo.githubusercontent.com/e498eead712d82d9ee1af0a4850acd2e46ea48c48fb9ce5a3d2ab64f28f95b34/687474703a2f2f696d672e736869656c64732e696f2f3a6c6963656e73652d6d69742d626c75652e737667)](http://doge.mit-license.org)[![Join the chat at https://gitter.im/zguillez/php-xmlog](https://camo.githubusercontent.com/e68127320b6322af496082c2a6573867a4557cd7aa33204462dbb403c666d580/68747470733a2f2f6261646765732e6769747465722e696d2f7a6775696c6c657a2f7068702d786d6c6f672e737667)](https://gitter.im/zguillez/php-xmlog?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)

PHP module for create XML and LOG files

Getting Started
===============

[](#getting-started)

### Add package to composer.json

[](#add-package-to-composerjson)

`composer require zguillez/php-xmlog`

```
//packaje.json
{
    "require": {
        "zguillez/php-xmlog": "^1.1.3"
    }
}

```

Usage:
======

[](#usage)

```
require 'vendor/autoload.php';

use Z\Log;

$params["filename"] = "register";
$params["path"] = "./logs/";

$log = new Log($params);

```

On this example, "register" is the name of the log file and "./logs" is the folder on this files will be saved. **This folder must exits and have write permitions**.

```
$log->insert('This is an update!');

```

This will create a file "register.log" with the text "This is an update!".

For create a XML file instead LOG file:

```
$params["type"] = Log::XML;

```

Options (true/false):
---------------------

[](#options-truefalse)

### 1 dated:

[](#1-dated)

```
$params["dated"]  = true;

```

Create a dated file name:

- true: register\_2016-03-12\_17:10:17.log
- false (default): register.log

### 2 clear:

[](#2-clear)

```
$params["clear"]  = true;

```

Overwrite last file:

- true: register.log (overwrite the file with new log text)
- false (default): register.log (new log text will added in new line)

### 3 backup:

[](#3-backup)

```
$params["backup"] = true;

```

Backup last file:

- true: register\_2016-03-12\_17:10:17\_backup.log
- false (default): (no backup file)

Configuration:
--------------

[](#configuration)

You can override the log options by a config function.

```
$log->config(["dated"=>true]);

```

Example:
========

[](#example)

```
require 'vendor/autoload.php';

$params["type"]   = Log::LOG;
$params["filename"]   = "register";
$params["path"]   = "./logs/";
$params["dated"]  = false;
$params["clear"]  = false;
$params["backup"] = false;

$log = new Log($params);

$log->config(["dated"=>true]);

$log->insert('This is update one!');
$log->insert('This is update two!');

```

Contributing and issues
=======================

[](#contributing-and-issues)

Contributors are welcome, please fork and send pull requests! If you have any ideas on how to make this project better then please submit an issue or send me an [email](mailto:mail@zguillez.io).

License
=======

[](#license)

©2019 Zguillez.io

Original code licensed under [MIT](https://en.wikipedia.org/wiki/MIT_License) Open Source projects used within this project retain their original licenses.

Changelog
=========

[](#changelog)

### v1.1.0 (September 9, 2016)

[](#v110-september-9-2016)

- Configuration object

### v1.0.0 (March 12, 2016)

[](#v100-march-12-2016)

- Initial implementation

###  Health Score

30

—

LowBetter than 62% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity13

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity67

Established project with proven stability

 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 ~209 days

Recently: every ~261 days

Total

6

Last Release

2717d ago

Major Versions

0.0.1 → 1.0.02016-03-12

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/2631152?v=4)[Guillermo de la Iglesia](/maintainers/zguillez)[@zguillez](https://github.com/zguillez)

---

Top Contributors

[![zguillez](https://avatars.githubusercontent.com/u/2631152?v=4)](https://github.com/zguillez "zguillez (14 commits)")

---

Tags

logpackagistphpxmllogphpxml

### Embed Badge

![Health badge](/badges/zguillez-php-xmlog/health.svg)

```
[![Health](https://phpackages.com/badges/zguillez-php-xmlog/health.svg)](https://phpackages.com/packages/zguillez-php-xmlog)
```

###  Alternatives

[opengento/module-webapi-logger

This module allows you to analyze all the webapi rest done call toward your Magento.

1016.9k](/packages/opengento-module-webapi-logger)

PHPackages © 2026

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