Skip to content
This repository was archived by the owner on Apr 24, 2023. It is now read-only.

ashlog-rest/ashlog

Repository files navigation

AshLog

Open Source API and web app to handle logs with ease.

Donate using Liberapay Deploy

Documentation

Read the documentation on: https://ashlog.readthedocs.io.

Examples

JavaScript example

import axios from 'axios';

axios({
    method: 'POST',
    url: 'http://localhost:8000/api/log/',
    body: {
        project: projectID,
        event: 'Hello World!',
    },
    headers: {
        Authorization: `Bearer ${token}`,
    },
});

Python example

import requests

headers = {
    'Authorization': f'Bearer {token}',
}

data = {
    'project': project_id,
    'event': 'Hello World!',
}

requests.post(
    'http://localhost:8000/api/log/',
    json=data,
    headers=headers,
)

Trigger actions

When a request is sent you can also trigger one or more actions. For instance, you can send a telegram message with the event as text using the send_telegram action:

import requests

headers = {
    'Authorization': f'Bearer {token}',
}

data = {
    'project': project_id,
    'event': 'Hello World!',
    'actions': [
        {
            'action': 'send_telegram',
            'args': {
                'chat_id': telegram_chat_id,
            },
        },
    ],
}

requests.post(
    'http://localhost:8000/api/log/',
    json=data,
    headers=headers,
)

About

Open Source API and web app to handle logs with ease.

Topics

Resources

License

Stars

Watchers

Forks

Contributors 2

  •  
  •  

Languages