Define Custom Logger in Ray server application with multiple apps

It seems like Ray Serve is not able to log the details in the custom log file I am defining, can anyone help

Here is my logger initialization

from ray import serve
import logging

logger = logging.getLogger("ray.serve")

And here is my main inference function

    async def __call__(self, request):
        image_path = await request.body()
        im ="RGB")
        # prepare image for the model
        encoded_inputs = self.processor(
            im, return_tensors="pt", padding="max_length", truncation=True

        # make sure all keys of encoded_inputs are on the same device as the model
        for k, v in encoded_inputs.items():
            encoded_inputs[k] =

        # forward pass
        outputs = self.model(**encoded_inputs)
        logits = outputs.logits
        predicted_class_idx = logits.argmax(-1).item()
        del logits
        del outputs
        del im 
        # Finally class index to actual class"Request completed")
        return self.idx2label[predicted_class_idx]

The target is to log the custom information during inference in a separate logging file, not in the default location of ray serve logs /tmp/ray/session.......

@shrekris any help on this topic, would love to hear your response

So, Now I am able to get the logs from tmp dir to the custom dir I have in system with mapping volumes in docker compose

      - /mnt/efs/fs1/logs/:/tmp/ray/

But It contains lot of information what I want to exclude and also , Few things I want to log custom in the inference service, Is there any way to change this configuration

Hi wgetdd.deb, do you mind sharing what you change to have the correct log path? So that i can help to check why you have unnecessary information.