Question

Activation records and log messages not appearing for my Serverless Function

I get no activation records or log messages when I run serverless functions via doctl. I have a working python 3.11 serverless function that does what I expect, except that logging doesn’t appear anywhere, and there are no activation records-

$ doctl serverless activations list hello-world/mainy
Datetime    Status    Kind    Version    Activation ID    Start    Wait    Duration    Function
(no records, just headers)
$ doctl serverless activations list
Datetime    Status    Kind    Version    Activation ID    Start    Wait    Duration    Function
(no records, just headers)

$ doctl serverless activations logs -f hello-world/mainy
(no output)
$ doctl serverless activations logs
(no output)

I’ve run the function successfully a handful of times, and still nothing. Is there a latency period for logs to appear? I started yesterday, still seeing nothing today.

Here is the function def-

import json
import logging

logging.basicConfig(level=logging.DEBUG)
logger = logging.getLogger(__name__)


def main(args):
    try:
        logger.warning("Starting hello-world function")
        logger.warning(str(args))
        logger.info("This is an info log")
        logger.debug("This is a debug log")

        name = args.get("name", "")
        if not name:
            name = "world"

        retval = {
            "statusCode": 200,
            "headers": {
                'Content-Type': 'text/html',
            },
            "body": f"""<html><body>Hello, {name}<br><br><pre>
Type: "{type(args)}"
Class: "{args.__class__.__name__}"

{json.dumps(args, indent=4, sort_keys=True)}</pre></body></html>""",
        }
        logger.warning(f"Returning: {retval}")
        logger.error(f"Returning: {json.dumps(retval)}")
        return retval

    except Exception as e:
        logger.exception(e)
        return {"error": str(e)}

project.yml:

packages:
  - name: hello-world
    functions:
      - name: mainy
        parameters:
        runtime: "python:3.11"
        web: true
        limits:
          timeout: 10000  # 10 seconds
          memory: 512

DM me for URL / function UUID.

Regarding third-party logging / log forwarding, I’d rather not use or pay for external logging while I’m just trying out Functions, you know what I mean? I’m want to get something working, to learn whether DO Functions meets my needs. If it looks production-worthy and I continue development, then I’ll sign up for external logging.

At this point, I’m having to embed log type info into my response object, which isn’t ideal but it’s getting me by for now.

Also fyi-

  • the topic of local or non-external logging doesn’t appear to be covered in DO’s docs
  • for basic stuff I’m having to rely on forums and LLMs to figure out how things work, because the docs are very limited. For example, How to Develop Functions shows output of logs via doctl, but there’s no code or project.yml provided to show how that was made possible
  • There is a page on project.yml, but it’s just basic examples and doesn’t list all possible keys and values in a way similar to the App Platform app spec is… in other words, a comprehensive / complete schema is needed, otherwise we’re searching the web to find out what other developers have done
  • I tried out DO’s LLM chatbot and it hallucinated doctl examples for commands and subcommands that do not exist

Submit an answer


This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Bobby Iliev
Site Moderator
Site Moderator badge
May 22, 2025

Hi there,

If you’re calling the function via its public web: true URL, that might be why you’re not seeing any activation records or logs, I think that those only show up when you invoke the function using doctl.

Also, sometimes the logging module doesn’t behave as expected in these lightweight runtimes. I’ve got logs working with log forwarding, but if you don’t want to try those aout, not 100% sure if there’s another issue here, so it might be worth reaching out to support for a closer look: https://do.co/support

- Bobby

Become a contributor for community

Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.

DigitalOcean Documentation

Full documentation for every DigitalOcean product.

Resources for startups and SMBs

The Wave has everything you need to know about building a business, from raising funding to marketing your product.

Get our newsletter

Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.

New accounts only. By submitting your email you agree to our Privacy Policy

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.