Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update README.md: simplification #14

Merged
merged 1 commit into from
Oct 24, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
81 changes: 12 additions & 69 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,79 +1,22 @@
# Logtail - PHP Logging Made Easy

[![Logtail dashboard](https://user-images.githubusercontent.com/19272921/154085622-59997d5a-3f91-4bc9-a815-3b8ead16d28d.jpeg)](https://betterstack.com/logtail)
# [Better Stack](https://betterstack.com/logs) PHP client

📣 Logtail is now part of Better Stack. [Learn more ⇗](https://betterstack.com/press/introducing-better-stack/)

[![License: ISC](https://img.shields.io/badge/License-ISC-blue.svg)](LICENSE.md) ![Unit tests](https://github.com/logtail/logtail-php/actions/workflows/main.yml/badge.svg)
[![PHP version](https://badge.fury.io/ph/logtail%2Fmonolog-logtail.svg)](https://badge.fury.io/ph/logtail%2Fmonolog-logtail)
[![Better Stack dashboard](https://github.com/logtail/logtail-python/assets/10132717/e2a1196b-7924-4abc-9b85-055e17b5d499)](https://betterstack.com/logs)

Collect logs from your PHP projects, including Laravel, Symfony, CodeIgniter, CakePHP, Zend, and more.
[![ISC License](https://img.shields.io/badge/license-ISC-ff69b4.svg)](LICENSE.md)
[![PHP package](https://badge.fury.io/ph/logtail%2Fmonolog-logtail.svg)](https://badge.fury.io/ph/logtail%2Fmonolog-logtail)
[![Build](https://github.com/logtail/monolog-logtail/actions/workflows/main.yml/badge.svg?branch=master)](https://github.com/logtail/monolog-logtail/actions/workflows/main.yml)

[Logtail](https://betterstack.com/logtail) is a hosted service that centralizes all of your logs into one place. Allowing for analysis, correlation and filtering with SQL. Actionable Grafana dashboards and collaboration come built-in. Logtail works with [any language or platform and any data source](https://docs.logtail.com/).
Experience SQL-compatible structured log management based on ClickHouse. [Learn more ⇗](https://betterstack.com/logs)

### Features
- Simple integration. Built on well-known Monolog logging library.
- Support for structured logging and events.
- Automatically captures useful context.
- Performant, light weight, with a thoughtful design.
## Documentation

### Supported language versions
- PHP 8 or newer
- Composer 1.10.1 or newer
[Getting started ⇗](https://betterstack.com/docs/logs/php/)

# Installation

Install the Logtail Monolog library using composer:

```bash
composer require logtail/monolog-logtail
```

**Using older Monolog?** Install Logtail for Monolog 2:

```bash
composer require logtail/monolog-logtail:^2.0.0
```
---

# Example project

To help you get started with using Logtail in your PHP projects, we have prepared a simple program that showcases the usage of Logtail logger.

## Download and install the example project

You can download the [example project](https://github.com/logtail/monolog-logtail/tree/master/example-project) from GitHub directly or you can clone it to a select directory. In that directory, run the following command:

```bash
composer update
```
This command will install all dependencies from `composer.json` file and lock them in `composer.lock` file.

## Run the example project

To run the example application, simply run the following command:

```bash
php index.php <source-token>
```

*Don't forget to replace `<source-token>` with your actual source token which you can find by going to logtail.com -> sources -> edit.*

You should see the following output:
```text
All done, you can check your logs in the control panel.
```

This will create and send a total of 8 log messages to the Logtail. Each message corresponds to a specific log level. Detail explanation follows below.

## Explore how example project works

Learn how to setup PHP logging by exploring the workings of the [example project](https://github.com/logtail/monolog-logtail/tree/master/example-project) in detail.

## Improved performance with batches
We extend `Monolog\Handler\BufferHandler` to send your logs periodically in batches for optimized network traffic by default. If you don't want to use batches or you want to use your own buffer handler, use `SynchronousLogtailHandler` instead.
## Need help?
Please let us know at [[email protected]](mailto:[email protected]). We're happy to help!

---

## Get in touch

Have any questions? Please explore the Logtail [documentation](https://docs.logtail.com/) or contact our [support](https://betterstack.com/help).
[ISC license](https://github.com/logtail/monolog-logtail/blob/master/LICENSE.md), [example project](https://github.com/logtail/monolog-logtail/tree/master/example-project)