diff --git a/nslsii/__init__.py b/nslsii/__init__.py
index c3a3654..de86137 100644
--- a/nslsii/__init__.py
+++ b/nslsii/__init__.py
@@ -273,7 +273,8 @@ def configure_bluesky_logging(ipython, appdirs_appname="bluesky"):
 
     The log file path is taken from environment variable BLUESKY_LOG_FILE, if
     that variable has been set. If not the default log file location is determined
-    by the appdirs package.
+    by the appdirs package. The default log directory will be created if it does
+    not exist.
 
     Parameters
     ----------
@@ -300,14 +301,18 @@ def configure_bluesky_logging(ipython, appdirs_appname="bluesky"):
             file=sys.stderr,
         )
     else:
-        bluesky_log_file_path = Path(
+        bluesky_log_dir = Path(
             appdirs.user_log_dir(appname=appdirs_appname)
-        ) / Path("bluesky.log")
+        )
+        if not bluesky_log_dir.exists():
+            bluesky_log_dir.mkdir(parents=True, exist_ok=True)
+        bluesky_log_file_path = bluesky_log_dir / Path("bluesky.log")
         print(
             f"environment variable BLUESKY_LOG_FILE is not set,"
             f" using default log file path '{bluesky_log_file_path}'",
             file=sys.stderr,
         )
+
     log_file_handler = TimedRotatingFileHandler(
         filename=str(bluesky_log_file_path), when="W0", backupCount=10
     )
@@ -376,9 +381,12 @@ def configure_ipython_logging(
             file=sys.stderr,
         )
     else:
-        bluesky_ipython_log_file_path = Path(
+        bluesky_ipython_log_dir = Path(
             appdirs.user_log_dir(appname=appdirs_appname)
-        ) / Path("bluesky_ipython.log")
+        )
+        if not bluesky_ipython_log_dir.exists():
+            bluesky_ipython_log_dir.mkdir(parents=True, exist_ok=True)
+        bluesky_ipython_log_file_path = bluesky_ipython_log_dir / Path("bluesky_ipython.log")
         print(
             "environment variable BLUESKY_IPYTHON_LOG_FILE is not set,"
             f" using default file path '{bluesky_ipython_log_file_path}'",

provide a reasonable bluesky log file path for Windows
The bluesky log path is /var/log/bluesky/bluesky.log. This is not reasonable for Windows.
diff --git a/nslsii/tests/test_logutils.py b/nslsii/tests/test_logutils.py
index 5cb3eb9..edb5222 100644
--- a/nslsii/tests/test_logutils.py
+++ b/nslsii/tests/test_logutils.py
@@ -1,5 +1,6 @@
 import os
 from pathlib import Path
+import shutil
 import stat
 from unittest.mock import MagicMock
 
@@ -57,24 +58,47 @@ def test_configure_bluesky_logging_with_unwriteable_dir(tmpdir):
         configure_bluesky_logging(ipython=ip,)
 
 
-def test_default_bluesky_logging():
+def test_configure_bluesky_logging_creates_default_dir():
     """
     Remove environment variable BLUESKY_LOG_FILE and test that
-    the default log file path is used. This test creates a
+    the default log file path is created. This test creates a
     directory rather than using pytest's tmp_path so the test
     must clean up at the end.
     """
     test_appname = "bluesky-test"
-    user_log_dir = Path(appdirs.user_log_dir(appname=test_appname))
+    log_dir = Path(appdirs.user_log_dir(appname=test_appname))
+    # remove log_dir if it exists to test that it will be created
+    if log_dir.exists():
+        shutil.rmtree(path=log_dir)
+    log_file_path = log_dir / Path("bluesky.log")
 
-    # log directory must exist
-    # nslsii.configure_bluesky_logging() will not create it
-    user_log_dir.mkdir(parents=True)
+    ip = IPython.core.interactiveshell.InteractiveShell()
+    os.environ.pop("BLUESKY_LOG_FILE", default=None)
 
-    log_file_path = Path(appdirs.user_log_dir(appname=test_appname)) / Path(
-        "bluesky.log"
+    bluesky_log_file_path = configure_bluesky_logging(
+        ipython=ip, appdirs_appname=test_appname
     )
+    assert bluesky_log_file_path == log_file_path
+    assert log_file_path.exists()
+
+    # clean up the file and directory this test creates
+    bluesky_log_file_path.unlink()
+    bluesky_log_file_path.parent.rmdir()
+
+
+def test_configure_bluesky_logging_existing_default_dir():
+    """
+    Remove environment variable BLUESKY_LOG_FILE and test that
+    the default log file path is used. This test creates a
+    directory rather than using pytest's tmp_path so the test
+    must clean up at the end.
+    """
+    test_appname = "bluesky-test"
+    log_dir = Path(appdirs.user_log_dir(appname=test_appname))
+    # create the default log directory
+    log_dir.mkdir(parents=True, exist_ok=True)
 
+    log_file_path = log_dir / Path("bluesky.log")
     ip = IPython.core.interactiveshell.InteractiveShell()
     os.environ.pop("BLUESKY_LOG_FILE", default=None)
 
@@ -97,14 +121,45 @@ def test_ipython_log_exception():
     ip.logger.log_write.assert_called_with("Exception\n", kind="output")
 
 
-def test_default_ipython_exc_logging():
+def test_ipython_exc_logging_creates_default_dir():
+    """
+    Remove environment variable BLUESKY_IPYTHON_LOG_FILE and
+    test that the default log file path is created. This test creates
+    a directory rather than using pytest's tmp_path so the test
+    must clean up at the end.
+    """
     test_appname = "bluesky-test"
     log_dir = Path(appdirs.user_log_dir(appname=test_appname))
+    # remove log_dir if it exists to test that it will be created
+    if log_dir.exists():
+        shutil.rmtree(path=log_dir)
     log_file_path = log_dir / Path("bluesky_ipython.log")
 
-    # the log directory must exist already
-    # nslsii.configure_ipython_exc_logging() will not create it
-    log_dir.mkdir(parents=True)
+    ip = IPython.core.interactiveshell.InteractiveShell()
+    os.environ.pop("BLUESKY_IPYTHON_LOG_FILE", default=None)
+    bluesky_ipython_log_file_path = configure_ipython_logging(
+        exception_logger=log_exception, ipython=ip, appdirs_appname=test_appname
+    )
+
+    assert bluesky_ipython_log_file_path == log_file_path
+    assert log_file_path.exists()
+
+    bluesky_ipython_log_file_path.unlink()
+    bluesky_ipython_log_file_path.parent.rmdir()
+
+
+def test_ipython_exc_logging_existing_default_dir():
+    """
+    Remove environment variable BLUESKY_IPYTHON_LOG_FILE and
+    test that the default log file path is used. This test creates
+    a directory rather than using pytest's tmp_path so the test
+    must clean up at the end.
+    """
+    test_appname = "bluesky-test"
+    log_dir = Path(appdirs.user_log_dir(appname=test_appname))
+    # create the default log directory
+    log_dir.mkdir(parents=True, exist_ok=True)
+    log_file_path = log_dir / Path("bluesky_ipython.log")
 
     ip = IPython.core.interactiveshell.InteractiveShell()
     os.environ.pop("BLUESKY_IPYTHON_LOG_FILE", default=None)

pip install -e .[dev]
parse_log_pytest
requirements.txt
pytest pytest-cov pytest-xdist pytest-mock pytest-asyncio
apt-get update apt-get install -y gcc
3.9
requirements.txt
pytest --no-header -rA --tb=line --color=no -p no:cacheprovider -W ignore::DeprecationWarning
appdirs==1.4.4
asciitree==0.3.3
asttokens==3.0.0
attrs==25.3.0
bluesky==1.13.1
bluesky-kafka==0.10.0
bluesky-live==0.0.8
boltons==25.0.0
cachetools==5.5.2
caproto==1.2.0
certifi==2025.1.31
charset-normalizer==3.4.1
click==8.1.8
cloudpickle==3.1.1
comm==0.2.2
confluent-kafka==2.9.0
contourpy==1.3.0
coverage==7.8.0
cycler==0.12.1
dask==2024.8.0
databroker==1.2.5
decorator==5.2.1
Deprecated==1.2.18
dnspython==2.7.0
doct==1.1.0
entrypoints==0.4
event-model==1.22.3
exceptiongroup==1.2.2
execnet==2.1.1
executing==2.2.0
fasteners==0.19
flexcache==0.3
flexparser==0.4
fonttools==4.56.0
fsspec==2025.3.2
historydict==1.2.6
humanize==4.12.2
idna==3.10
imageio==2.37.0
importlib_metadata==8.6.1
importlib_resources==6.5.2
iniconfig==2.1.0
intake==0.6.4
ipython==8.18.1
ipywidgets==8.1.5
jedi==0.19.2
Jinja2==3.1.6
jsonschema==4.23.0
jsonschema-specifications==2024.10.1
jupyterlab_widgets==3.0.13
kiwisolver==1.4.7
locket==1.0.0
MarkupSafe==3.0.2
matplotlib==3.9.4
matplotlib-inline==0.1.7
mongoquery==1.4.2
msgpack==1.1.0
msgpack-numpy==0.4.8
networkx==3.2.1
-e git+https://github.com/NSLS-II/nslsii.git@8c5ccb2fc7416387b46f64d5f286de0a77162cda#egg=nslsii
numcodecs==0.12.1
numpy==2.0.2
opentelemetry-api==1.31.1
ophyd==1.10.0
packaging==24.2
pandas==2.2.3
parso==0.8.4
partd==1.4.2
pexpect==4.9.0
pillow==11.1.0
PIMS==0.7
Pint==0.24.4
platformdirs==4.3.7
pluggy==1.5.0
prettytable==3.16.0
prompt_toolkit==3.0.50
psutil==7.0.0
ptyprocess==0.7.0
pure_eval==0.2.3
Pygments==2.19.1
pymongo==4.11.3
pyOlog==4.5.1
pyparsing==3.2.3
pytest==8.3.5
pytest-asyncio==0.26.0
pytest-cov==6.0.0
pytest-mock==3.14.0
pytest-xdist==3.6.1
python-dateutil==2.9.0.post0
pytz==2025.2
PyYAML==6.0.2
referencing==0.36.2
requests==2.32.3
rpds-py==0.24.0
six==1.17.0
slicerator==1.1.0
stack-data==0.6.3
suitcase-mongo==0.7.0
suitcase-msgpack==0.3.0
suitcase-utils==0.5.4
tifffile==2024.8.30
tomli==2.2.1
toolz==1.0.0
tqdm==4.67.1
traitlets==5.14.3
typing_extensions==4.13.0
tzdata==2025.2
tzlocal==5.3.1
urllib3==2.3.0
wcwidth==0.2.13
widgetsnbextension==4.0.13
wrapt==1.17.2
xarray==2024.7.0
zarr==2.18.2
zipp==3.21.0

name: nslsii
channels:
  - defaults
  - https://repo.anaconda.com/pkgs/main
  - https://repo.anaconda.com/pkgs/r
  - conda-forge
dependencies:
  - _libgcc_mutex=0.1=main
  - _openmp_mutex=5.1=1_gnu
  - ca-certificates=2025.2.25=h06a4308_0
  - ld_impl_linux-64=2.40=h12ee557_0
  - libffi=3.4.4=h6a678d5_1
  - libgcc-ng=11.2.0=h1234567_1
  - libgomp=11.2.0=h1234567_1
  - libstdcxx-ng=11.2.0=h1234567_1
  - ncurses=6.4=h6a678d5_0
  - openssl=3.0.16=h5eee18b_0
  - pip=25.0=py39h06a4308_0
  - python=3.9.21=he870216_1
  - readline=8.2=h5eee18b_0
  - setuptools=75.8.0=py39h06a4308_0
  - sqlite=3.45.3=h5eee18b_0
  - tk=8.6.14=h39e8969_0
  - wheel=0.45.1=py39h06a4308_0
  - xz=5.6.4=h5eee18b_1
  - zlib=1.2.13=h5eee18b_1
  - pip:
      - appdirs==1.4.4
      - asciitree==0.3.3
      - asttokens==3.0.0
      - attrs==25.3.0
      - bluesky==1.13.1
      - bluesky-kafka==0.10.0
      - bluesky-live==0.0.8
      - boltons==25.0.0
      - cachetools==5.5.2
      - caproto==1.2.0
      - certifi==2025.1.31
      - charset-normalizer==3.4.1
      - click==8.1.8
      - cloudpickle==3.1.1
      - comm==0.2.2
      - confluent-kafka==2.9.0
      - contourpy==1.3.0
      - coverage==7.8.0
      - cycler==0.12.1
      - dask==2024.8.0
      - databroker==1.2.5
      - decorator==5.2.1
      - deprecated==1.2.18
      - dnspython==2.7.0
      - doct==1.1.0
      - entrypoints==0.4
      - event-model==1.22.3
      - exceptiongroup==1.2.2
      - execnet==2.1.1
      - executing==2.2.0
      - fasteners==0.19
      - flexcache==0.3
      - flexparser==0.4
      - fonttools==4.56.0
      - fsspec==2025.3.2
      - historydict==1.2.6
      - humanize==4.12.2
      - idna==3.10
      - imageio==2.37.0
      - importlib-metadata==8.6.1
      - importlib-resources==6.5.2
      - iniconfig==2.1.0
      - intake==0.6.4
      - ipython==8.18.1
      - ipywidgets==8.1.5
      - jedi==0.19.2
      - jinja2==3.1.6
      - jsonschema==4.23.0
      - jsonschema-specifications==2024.10.1
      - jupyterlab-widgets==3.0.13
      - kiwisolver==1.4.7
      - locket==1.0.0
      - markupsafe==3.0.2
      - matplotlib==3.9.4
      - matplotlib-inline==0.1.7
      - mongoquery==1.4.2
      - msgpack==1.1.0
      - msgpack-numpy==0.4.8
      - networkx==3.2.1
      - numcodecs==0.12.1
      - numpy==2.0.2
      - opentelemetry-api==1.31.1
      - ophyd==1.10.0
      - packaging==24.2
      - pandas==2.2.3
      - parso==0.8.4
      - partd==1.4.2
      - pexpect==4.9.0
      - pillow==11.1.0
      - pims==0.7
      - pint==0.24.4
      - platformdirs==4.3.7
      - pluggy==1.5.0
      - prettytable==3.16.0
      - prompt-toolkit==3.0.50
      - psutil==7.0.0
      - ptyprocess==0.7.0
      - pure-eval==0.2.3
      - pygments==2.19.1
      - pymongo==4.11.3
      - pyolog==4.5.1
      - pyparsing==3.2.3
      - pytest==8.3.5
      - pytest-asyncio==0.26.0
      - pytest-cov==6.0.0
      - pytest-mock==3.14.0
      - pytest-xdist==3.6.1
      - python-dateutil==2.9.0.post0
      - pytz==2025.2
      - pyyaml==6.0.2
      - referencing==0.36.2
      - requests==2.32.3
      - rpds-py==0.24.0
      - six==1.17.0
      - slicerator==1.1.0
      - stack-data==0.6.3
      - suitcase-mongo==0.7.0
      - suitcase-msgpack==0.3.0
      - suitcase-utils==0.5.4
      - tifffile==2024.8.30
      - tomli==2.2.1
      - toolz==1.0.0
      - tqdm==4.67.1
      - traitlets==5.14.3
      - typing-extensions==4.13.0
      - tzdata==2025.2
      - tzlocal==5.3.1
      - urllib3==2.3.0
      - wcwidth==0.2.13
      - widgetsnbextension==4.0.13
      - wrapt==1.17.2
      - xarray==2024.7.0
      - zarr==2.18.2
      - zipp==3.21.0
prefix: /opt/conda/envs/nslsii

nslsii/tests/test_logutils.py::test_configure_bluesky_logging_creates_default_dir
nslsii/tests/test_logutils.py::test_configure_bluesky_logging_with_unwriteable_dir nslsii/tests/test_logutils.py::test_ipython_exc_logging_creates_default_dir nslsii/tests/test_logutils.py::test_ipython_exc_logging_existing_default_dir nslsii/tests/test_logutils.py::test_configure_ipython_exc_logging nslsii/tests/test_logutils.py::test_configure_ipython_exc_logging_with_nonexisting_dir nslsii/tests/test_logutils.py::test_configure_ipython_exc_logging_with_unwriteable_dir nslsii/tests/test_logutils.py::test_configure_ipython_exc_logging_file_exists nslsii/tests/test_logutils.py::test_configure_ipython_exc_logging_rotate
nslsii/tests/test_logutils.py::test_configure_bluesky_logging nslsii/tests/test_logutils.py::test_configure_bluesky_logging_with_nonexisting_dir nslsii/tests/test_logutils.py::test_configure_bluesky_logging_existing_default_dir nslsii/tests/test_logutils.py::test_ipython_log_exception
nslsii/__init__.py
nslsii/__init__.py