-
Notifications
You must be signed in to change notification settings - Fork 0
/
readme.txt
116 lines (81 loc) · 4.06 KB
/
readme.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
=== BetterStack Logger ===
Contributors: millertchris
Donate link: https://github.com/sponsors/millertchris
Plugin Name: BetterStack Logger
Plugin URI: https://prolificdigital.com
Tags: betterstack, logger, logging, debug, monitor
Stable tag: 1.0.0
Requires at least: 6.0
Requires PHP: 8.0
Tested up to: 6.6
Author: Prolific Digital
Author URI: https://prolificdigital.com
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: betterstack-logger
Seamlessly integrate with BetterStack to log messages directly from your WordPress site.
== Description ==
BetterStack Logger is a powerful WordPress plugin that allows you to seamlessly integrate BetterStack with your WordPress site. Enhance your logging capabilities by sending error messages, post changes, user actions, and more directly to BetterStack. With easy configuration and flexible logging functions, this plugin is an essential tool for developers and site administrators looking to keep track of their site's activities.
## Features
- **Error Logging:** Capture and log WordPress errors directly to BetterStack.
- **User Action Logging:** Log important user actions such as logins, registrations, and profile updates.
- **Post Changes:** Monitor post creation, updates, and deletions.
- **Plugin and Theme Activity:** Log plugin activations/deactivations and theme switches.
- **Customizable Logging:** Use helper functions to log custom messages from anywhere in your codebase.
- **Settings Page:** Easily configure the API key, enable or disable specific logging features via the WordPress admin panel.
- **Support for `wp-config.php`:** Define your BetterStack API key in `wp-config.php` for additional security.
## Installation
### From Your WordPress Dashboard
1. Navigate to `Plugins` -> `Add New`.
2. Search for `BetterStack Logger`.
3. Click `Install Now`.
4. Activate the plugin.
5. Go to `Tools` -> `BetterStack Logger Settings` to configure the plugin.
### Manual Installation
1. Download the plugin from the [Plugin Releases](https://github.com/prolific-digital/betterstack-logger/releases).
2. Upload the `betterstack-logger` directory to the `/wp-content/plugins/` directory.
3. Activate the plugin through the `Plugins` menu in WordPress.
4. Go to `Tools` -> `BetterStack Logger Settings` to configure the plugin.
## Configuration
### API Key
To log messages to BetterStack, you need to set up your API key:
1. Go to `Tools` -> `BetterStack Logger Settings`.
2. Enter your BetterStack API key in the `API Key` field.
3. Optionally, define the API key in your `wp-config.php` file using `BETTERSTACK_API_KEY`.
### Logging Options
- **Enable Error Logging:** Toggle to capture WordPress errors.
- **Enable Event Logging:** Toggle to log user actions, post changes, and more.
## Usage
### Logging Custom Messages
Use the following functions to log messages from anywhere in your code:
```php
// Log a custom message
better_error_log('This is a custom error message.');
// Shorter version
b_log('This is a quick log message.');
```
### Example:
```php
function my_custom_function() {
// Perform some task
// ...
// Log a message
better_error_log('Task completed successfully.');
}
add_action('init', 'my_custom_function');
```
### Available Functions
- `better_error_log($message)`: Logs a custom message to BetterStack.
- `b_log($message)`: Shorthand function to log a custom message to BetterStack.
## Frequently Asked Questions
Can I define the API key in `wp-config.php`?
Yes! For added security, you can define your API key in `wp-config.php` using:
```php
define('BETTERSTACK_API_KEY', 'your-api-key-here');
```
What types of events can I log with BetterStack Logger?
You can log errors, user actions (e.g., logins, registrations), post changes (e.g., creation, updates, deletions), plugin activations/deactivations, theme switches, and custom messages.
## Support
If you need help or have any questions, feel free to reach out to us:
- Visit our [Support Page](https://prolificdigital.notion.site/BetterStack-Logger-c0cc4526efd049c09b77965bf3ecc28e)
- Email us at support@prolificdigital.com