Skip to content

Commit

Permalink
Initial Commit
Browse files Browse the repository at this point in the history
  • Loading branch information
GonzoInc committed Nov 8, 2018
0 parents commit 1bdc584
Show file tree
Hide file tree
Showing 13 changed files with 2,595 additions and 0 deletions.
8 changes: 8 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Ignore the following files
.settings
.project
.DS_Store
.idea/*
/vendor/
/logs/*
/logs/codeSniffReport.txt
674 changes: 674 additions & 0 deletions LICENSE

Large diffs are not rendered by default.

63 changes: 63 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
# GLogger

Project created by [Greg Dean](https://github.com/gonzoinc)

## About

Glogger is a simple logger class implementing [Klogger](https://github.com/katzgrau/KLogger). It's basically a wrapper. The purpose of this was a simpler way to use Klogger throughout an application. Constants are now used which allows easier management, configurability and ease of use.

## Installation

Installation is done strictly with Composer and loaded with it's autoload feature.

```bash
composer require gonzoinc/glogger
```
In your `composer.json`:

``` json
{
"require": {
"gonzoinc/glogger": "1.0.0"
}
}
```

## Usage

Check Sample file for working example of the class and examples of the various logging levels.

The Constants used are defined in the init.php file. Be sure to copy them over to your application and set them as needed.

```php

<?php

require_once "init.php";

// Composer required modules
require_once 'vendor/autoload.php';

use Glogger\Log;

$logger = new Log();

$logger->debug("This is a debug message");

$logger->warn("This is a warning message");

$logger->info("This is an info message");

$logger->error("This is an error message");

$logger->critical("This is a critical message");
```
The logger class is set to create the log file in a JSON logstash format. This was personal taste since I use elasticsearch to consume all my logs.

## Contributing
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Please make sure to update tests as appropriate. *** PHPUnit Tests are to Follow ***

## License
[GPL-3.0](https://choosealicense.com/licenses/gpl-3.0/)
34 changes: 34 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
{
"name": "gonzoinc/glogger",
"description": "Simple logger class implementing klogger",
"type": "project",
"authors": [
{
"name": "Gonzo Inc",
"email": "[email protected]"
}
],
"require": {
"php": ">=5.6.4",
"katzgrau/klogger": "^1.2.1"
},
"require-dev": {
"squizlabs/php_codesniffer": "3.*",
"phpunit/phpunit": "^5.0.0"
},
"minimum-stability": "stable",
"scripts": {
"post-install-cmd": [
"bash scripts/composer/setUpHooks.sh"
],
"test-standards": "phpcs",
"test": [
"@test-standards"
]
},
"autoload": {
"psr-4": {
"Glogger\\": "src/Logger/"
}
}
}
Loading

0 comments on commit 1bdc584

Please sign in to comment.