https://github.com/stackify/stackify-log-log4j12
Stackify Log Appender for Log4j 1.2
https://github.com/stackify/stackify-log-log4j12
java log4j logging stackify
Last synced: 8 months ago
JSON representation
Stackify Log Appender for Log4j 1.2
- Host: GitHub
- URL: https://github.com/stackify/stackify-log-log4j12
- Owner: stackify
- License: apache-2.0
- Created: 2014-06-16T21:11:08.000Z (about 12 years ago)
- Default Branch: master
- Last Pushed: 2025-06-27T15:38:15.000Z (12 months ago)
- Last Synced: 2025-07-10T00:20:55.900Z (12 months ago)
- Topics: java, log4j, logging, stackify
- Language: Java
- Homepage:
- Size: 91.8 KB
- Stars: 4
- Watchers: 14
- Forks: 3
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
[](http://mvnrepository.com/artifact/com.stackify/stackify-log-log4j12)
# Stackify Log4j 1.2 Logger
Log4j 1.2 appender for sending log messages and exceptions to Stackify.
* **Errors and Logs Overview:** http://support.stackify.com/errors-and-logs-overview/
* **Sign Up for a Trial:** http://www.stackify.com/sign-up/
## Installation
Add it as a maven dependency:
```xml
com.stackify
stackify-log-log4j12
4.0.1
runtime
```
## Usage
Example appender configuration (*.properties file):
```properties
log4j.appender.STACKIFY=com.stackify.log.log4j12.StackifyLogAppender
log4j.appender.STACKIFY.apiKey=YOUR_API_KEY
log4j.appender.STACKIFY.application=YOUR_APPLICATION_NAME
log4j.appender.STACKIFY.environment=YOUR_ENVIRONMENT
```
Example appender configuration (*.xml file):
```xml
```
Note: *If you are logging from a device that has the stackify-agent installed, the environment setting is optional. We will use the environment associated to your device in Stackify.*
Be sure to shutdown Log4j to flush this appender of any errors and shutdown the background thread:
```java
org.apache.log4j.LogManager.shutdown();
```
## Masking
The Stackify appender has built-in data masking for credit cards and social security number values.
**Enable Masking:**
Add `` inside the ` ... ` tag.
**Customize Masking:**
The example below has the following customizations:
1. Credit Card value masking is disabled (``)
2. IP Address masking is enabled (``).
3. Custom masking to remove vowels using a regex (` `)
```properties
log4j.appender.STACKIFY=com.stackify.log.log4j12.StackifyLogAppender
log4j.appender.STACKIFY.apiKey=YOUR_API_KEY
log4j.appender.STACKIFY.application=YOUR_APPLICATION_NAME
log4j.appender.STACKIFY.environment=YOUR_ENVIRONMENT
log4j.appender.STACKIFY.maskEnabled=true
log4j.appender.STACKIFY.maskCreditCard=false
log4j.appender.STACKIFY.maskSSN=true
log4j.appender.STACKIFY.maskIP=true
log4j.appender.STACKIFY.maskCustom=[aeiou]
```
```xml
```
## Legacy Support
For legacy support of **Java 1.6 and 1.7** use the following maven dependency:
```
com.stackify
stackify-log-log4j12
2.1.2
```
## License
Copyright 2020 Stackify, LLC.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.