Repository: PrefectHQ/prefect

Issue:
Logger from get_logger does not log to backend - prefect 2.0.4
### First check

- [X] I added a descriptive title to this issue.
- [X] I used the GitHub search to find a similar issue and didn't find it.
- [X] I searched the Prefect documentation for this issue.
- [X] I checked that this issue is related to Prefect and not one of its dependencies.

### Bug summary

The logger i get from get_logger does log in the local shell session but the logs do not show up in backend.

Logs with made by get_run_logger are captured as expected!

### Reproduction

```python
from prefect import flow, task
from prefect.logging import get_logger, get_run_logger


@flow
def world():
    get_logger().info("get_logger World")
    get_run_logger().info("get_run_logger World")


@task
def hello():
    get_logger().info(" get_logger Hello")
    get_run_logger().info("get_run_logger Hello")


@flow
def test_flow():
    get_logger().info("get_logger test")
    get_run_logger().info("get_run_logger test")
    hello()
    world()


test_flow()
```


### Error

Local logs
```
19:22:45.427 | INFO    | prefect.engine - Created flow run 'unyielding-wolverine' for flow 'test-flow'
19:22:46.433 | INFO    | prefect - get_logger test
19:22:46.433 | INFO    | Flow run 'unyielding-wolverine' - get_run_logger test
19:22:46.604 | INFO    | Flow run 'unyielding-wolverine' - Created task run 'hello-b3a437c7-0' for task 'hello'
19:22:46.605 | INFO    | Flow run 'unyielding-wolverine' - Executing 'hello-b3a437c7-0' immediately...
19:22:46.902 | INFO    | prefect -  get_logger Hello
19:22:46.903 | INFO    | Task run 'hello-b3a437c7-0' - get_run_logger Hello
19:22:47.170 | INFO    | Task run 'hello-b3a437c7-0' - Finished in state Completed()
19:22:47.732 | INFO    | Flow run 'unyielding-wolverine' - Created subflow run 'watchful-puffin' for flow 'world'
19:22:48.065 | INFO    | prefect - get_logger World
19:22:48.065 | INFO    | Flow run 'watchful-puffin' - get_run_logger World
19:22:48.273 | INFO    | Flow run 'watchful-puffin' - Finished in state Completed()
19:22:48.456 | INFO    | Flow run 'unyielding-wolverine' - Finished in state Completed('All states completed.')
```
Remote logs
<img width="943" alt="image" src="https://user-images.githubusercontent.com/24698503/187261871-9d89681e-03fe-4557-b942-b24fafb71be5.png">

Subflow logs
<img width="961" alt="image" src="https://user-images.githubusercontent.com/24698503/187261992-8d029968-434e-43f6-9d5b-cd405e250a9e.png">


### Versions

```

Version:             2.0.4
API version:         0.8.0
Python version:      3.8.10
Git commit:          39db6fb1
Built:               Wed, Aug 10, 2022 1:19 PM
OS/Arch:             linux/x86_64
Profile:             ci
Server type:         hosted

```


### Additional context

_No response_


Discussion:
Hi! `get_logger` is for Prefect's internal loggers and is not intended to be user facing. If you want logs from it to go to the backend, you can configure it in the `logging.yaml` file. See https://docs.prefect.io/concepts/logs/?h=logging#logging-configuration for more details on customizing logging.
The document you mentioned does not seem to contain any reference to `get_logger`?

I find it very surprising that the logger i get from `get_logger` does not log to the backend by default.
Especially because with prefect 1 `get_logger` would log to the backend.

Might be great if you could if you could at least add a better doc string.

```python
"""
    Get a `prefect` logger. For use within Prefect.
"""
```

Reads to me - for use with prefect. (at least if not read super carefully)

```python
"""
    Get a `prefect` logger. For use within Prefect. 
    WARNING: Does not log to the backend by default
"""
```


And if its for internal adding use only an underscore might be nice `_get_logger()`
The linked document describes how to use the `logging.yaml` file. There you could attach the Orion handler to arbitrary loggers.

We can update the docstring for clarity. Including an underscore would indicate that it's private to that module, which it isn't. We use it in other Prefect modules.

Resolving patch:
diff --git a/src/prefect/logging/loggers.py b/src/prefect/logging/loggers.py
--- a/src/prefect/logging/loggers.py
+++ b/src/prefect/logging/loggers.py
@@ -29,7 +29,11 @@ def process(self, msg, kwargs):
 @lru_cache()
 def get_logger(name: str = None) -> logging.Logger:
     """
-    Get a `prefect` logger. For use within Prefect.
+    Get a `prefect` logger. These loggers are intended for internal use within the
+    `prefect` package.
+
+    See `get_run_logger` for retrieving loggers for use within task or flow runs.
+    By default, only run-related loggers are connected to the `OrionHandler`.
     """
 
     parent_logger = logging.getLogger("prefect")
@@ -54,6 +58,9 @@ def get_run_logger(context: "RunContext" = None, **kwargs: str) -> logging.Logge
     The logger will be named either `prefect.task_runs` or `prefect.flow_runs`.
     Contextual data about the run will be attached to the log records.
 
+    These loggers are connected to the `OrionHandler` by default to send log records to
+    the API.
+
     Arguments:
         context: A specific context may be provided as an override. By default, the
             context is inferred from global state and this should not be needed.


Test patch: