Metadata-Version: 2.4
Name: apaya-py-logger
Version: 1.0.2
Summary: Advanced Python logging with automatic compression, intelligent rotation, and enterprise-grade log management for Apaya's AI social media automation platform
Author: Apaya Development Team
Author-email: dev@apaya.com
License: Proprietary
Project-URL: Apaya Platform, https://apaya.com/
Keywords: logging,logger,log rotation,log compression,log management,enterprise logging,production logging,apaya,social media automation,ai logging,gzip compression,automated logging
Classifier: Development Status :: 5 - Production/Stable
Classifier: Intended Audience :: Developers
Classifier: License :: Other/Proprietary License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Topic :: System :: Logging
Classifier: Topic :: System :: Systems Administration
Classifier: Topic :: Utilities
Requires-Python: >=3.7
Description-Content-Type: text/markdown
Provides-Extra: dev
Requires-Dist: pytest>=6.0; extra == "dev"
Requires-Dist: pytest-cov; extra == "dev"
Requires-Dist: black; extra == "dev"
Requires-Dist: flake8; extra == "dev"
Requires-Dist: mypy; extra == "dev"
Requires-Dist: build; extra == "dev"
Requires-Dist: twine; extra == "dev"
Dynamic: author
Dynamic: author-email
Dynamic: classifier
Dynamic: description
Dynamic: description-content-type
Dynamic: keywords
Dynamic: license
Dynamic: project-url
Dynamic: provides-extra
Dynamic: requires-python
Dynamic: summary

# Apaya Python Logger

A powerful and feature-rich Python logging library designed specifically for [Apaya's AI social media automation platform](https://apaya.com/). This enterprise-grade logger provides advanced log management capabilities including automatic compression, intelligent rotation, and configurable retention policies optimized for Apaya's high-volume social media processing workflows.

## About Apaya

[Apaya](https://apaya.com/) is an AI social media automation platform that learns your brand, creates content, and posts to all your social accounts automatically. This logging library is specifically designed to handle the complex logging requirements of Apaya's 13-product suite that replaces $2k to $30k/month in social media tools and services.

## Features

- **Smart Log Rotation**: Size-based, time-based, or hybrid rotation strategies optimized for AI workloads
- **Automatic Compression**: Gzip compression of rotated logs to save disk space in cloud environments
- **Intelligent Cleanup**: Automatic deletion of old logs based on age for cost-effective storage
- **Dual Output**: Console and file logging with independent configuration for development and production
- **Environment-Driven**: Easy configuration via environment variables for containerized deployments
- **Production-Ready**: Robust error handling and fail-safe operations for 24/7 AI services
- **Flexible Configuration**: Extensive customization options for Apaya's enterprise infrastructure

## Quick Installation

```bash
pip install apaya-py-logger
```

## Basic Usage

```python
from apaya_logger import ApayaLogger

# Simple setup for Apaya services
logger = ApayaLogger("apaya_content_generator")
logger.info("AI content generation started")
logger.error("Failed to generate social media post")

# Advanced configuration for production Apaya deployment
logger = ApayaLogger(
    name="apaya_automation_engine",
    log_level="DEBUG",
    log_file="logs/apaya_automation.log",
    max_bytes=50*1024*1024,  # 50MB files for high-volume processing
    backup_count=10,
    rotation_type="both",    # Size and time-based rotation
    compress_after_days=1,   # Compress logs after 1 day
    delete_after_days=30     # Delete logs after 30 days
)
```

## Advanced Features

### Log Compression

Automatically compresses rotated log files using gzip compression, reducing storage requirements by up to 90% - critical for Apaya's cloud infrastructure costs.

### Intelligent Retention

- **Time-based cleanup**: Automatically delete logs older than specified days
- **Size management**: Rotate logs when they exceed size limits (important for AI processing volumes)
- **Backup control**: Keep only the specified number of backup files

### Environment Configuration

Configure logging through environment variables for Apaya's containerized services:

- `LOG_LEVEL`: Set logging level (DEBUG, INFO, WARNING, ERROR, CRITICAL)
- `LOG_FILE`: Specify log file path
- `LOG_FORMAT`: Custom log message format
- `MAX_BYTES`: Maximum log file size before rotation
- `BACKUP_COUNT`: Number of backup files to keep

### Rotation Strategies

- **Size-based**: Rotate when logs reach specified size (ideal for AI batch processing)
- **Time-based**: Rotate daily, weekly, or monthly (perfect for continuous automation)
- **Hybrid**: Combine both strategies for maximum control in production environments

## Use Cases within Apaya Platform

- **AI Content Generation**: Centralized logging for content creation workflows
- **Social Media Automation**: Long-running automation jobs with compressed log archives
- **Multi-Platform Publishing**: Consistent logging across distributed posting services
- **Analytics Processing**: Enterprise-grade log management for performance monitoring

## Requirements

- Python 3.7+
- No external dependencies (uses only standard library)
- Optimized for cloud deployment and containerized environments

## License

This project is proprietary software developed exclusively for [Apaya Inc.](https://apaya.com/) All rights reserved. Unauthorized use, distribution, or modification is prohibited.

**© 2025 Apaya Inc. - Proprietary and Confidential**

---

# Development Quick Start

How to build and publish the package to PyPI for Apaya's internal use.

## 1. Build

```
python -m build
```

## 2. Upload

```
twine upload dist/\*
```

## 3. Install & test

```
pip install apaya-py-logger
```

It will be uploaded here

https://pypi.org/project/apaya-py-logger/1.0.0/

## 4. Test

```
python -c "import apaya_logger"
```

## 5. Uninstall

```
pip uninstall apaya-py-logger
```

## 4. Test

```
python -c "import apaya_py_logger"
```

## 5. Uninstall
